Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Ansible module for appliance info #847

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

caladd
Copy link
Contributor

@caladd caladd commented Oct 23, 2020

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
    }
}

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
    }
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant