Open
Conversation
An Ansible module for returning appliance info.
The module takes a single optional parameter:
`name` for requesting the data for a specific appliance. If name is not provided, then the data for all appliances is returned.
The data returned is a list of `appliances`.
Example playbook:
```
---
- hosts: localhost
tasks:
- name: Get all appliance info
stacki_appliance_info:
register: result
- name: All appliances output
debug:
var: result
- name: Get info for appliance backend
stacki_appliance_info:
name: backend
register: result
- name: Appliance backend output
debug:
var: result
```
Output of the debug commands, showing the structure of the data returned:
```
TASK [All appliances output] ********************************************************************
ok: [localhost] => {
"result": {
"appliances": [
{
"appliance": "backend",
"public": true
},
{
"appliance": "barnacle",
"public": false
},
{
"appliance": "builder",
"public": false
},
{
"appliance": "external",
"public": false
},
{
"appliance": "frontend",
"public": false
},
{
"appliance": "hypervisor",
"public": true
},
{
"appliance": "replicant",
"public": true
},
{
"appliance": "switch",
"public": false
}
],
"changed": false,
"failed": false
}
}
TASK [Appliance backend output] *****************************************************************
ok: [localhost] => {
"result": {
"appliances": [
{
"appliance": "backend",
"public": true
}
],
"changed": false,
"failed": false
}
}
```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An Ansible module for returning appliance info.
The module takes a single optional parameter:
namefor requesting the data for a specific appliance. If name is not provided, then the data for all appliances is returned.The data returned is a list of
appliances.Example playbook:
Output of the debug commands, showing the structure of the data returned: