ngine_io.cloudstack.cs_instance_info module – Gathering information from the API of instances from Apache CloudStack based clouds.
Note
This module is part of the ngine_io.cloudstack collection (version 2.3.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install ngine_io.cloudstack
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: ngine_io.cloudstack.cs_instance_info
.
New in ngine_io.cloudstack 0.1.0
Synopsis
Gathering information from the API of an instance.
Aliases: cs_instance_facts
Requirements
The below requirements are needed on the host that executes this module.
python >= 2.6
cs >= 0.9.0
Parameters
Parameter |
Comments |
---|---|
Account the instance is related to. |
|
HTTP method used to query the API endpoint. If not given, the Choices:
|
|
API key of the CloudStack API. If not given, the |
|
Secret key of the CloudStack API. If not set, the |
|
HTTP timeout in seconds. If not given, the Default: |
|
URL of the CloudStack API e.g. https://cloud.example.com/client/api. If not given, the |
|
Verify CA authority cert file. If not given, the |
|
Domain the instance is related to. |
|
Filter by host name. |
|
Name or display name of the instance. If not specified, all instances are returned |
|
Project the instance is related to. |
Notes
Note
A detailed guide about cloudstack modules can be found in the CloudStack Cloud Guide.
This module supports check mode.
Examples
- name: Gather instance information
ngine_io.cloudstack.cs_instance_info:
name: web-vm-1
register: vm
- name: Show the returned results of the registered variable
debug:
msg: "{{ vm }}"
- name: Gather information from all instances
ngine_io.cloudstack.cs_instance_info:
register: vms
- name: Show information on all instances
debug:
msg: "{{ vms }}"
- name: Gather information from all instances on a host
ngine_io.cloudstack.cs_instance_info:
host: host01.example.com
register: vms
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A list of matching instances. Returned: success |
|
Account the instance is related to. Returned: success Sample: |
|
Affinity groups the instance is in. Returned: success Sample: |
|
Date of the instance was created. Returned: success Sample: |
|
Default IP address of the instance. Returned: success Sample: |
|
Display name of the instance. Returned: success Sample: |
|
Domain the instance is related to. Returned: success Sample: |
|
Group name of the instance is related. Returned: success Sample: |
|
Host the instance is running on. Returned: success and instance is running Sample: |
|
Hypervisor related to this instance. Returned: success Sample: |
|
UUID of the instance. Returned: success Sample: |
|
Internal name of the instance (ROOT admin only). Returned: success Sample: |
|
Name of ISO the instance was deployed with. Returned: success Sample: |
|
Name of the instance. Returned: success Sample: |
|
List of dictionaries of the instance nics. Returned: success |
|
The broadcast uri of the nic. Returned: success Sample: |
|
The gateway of the nic. Returned: success Sample: |
|
The ID of the nic. Returned: success Sample: |
|
The ip address of the nic. Returned: success Sample: |
|
True if nic is default, false otherwise. Returned: success Sample: |
|
The isolation uri of the nic. Returned: success Sample: |
|
The mac address of the nic. Returned: success Sample: |
|
The netmask of the nic. Returned: success Sample: |
|
The ID of the corresponding network. Returned: success Sample: |
|
The name of the corresponding network. Returned: success Sample: |
|
The traffic type of the nic. Returned: success Sample: |
|
The type of the network. Returned: success Sample: |
|
The password of the instance if exists. Returned: success Sample: |
|
True if password setting is enabled. Returned: success Sample: |
|
Name of project the instance is related to. Returned: success Sample: |
|
Public IP address with instance via static NAT rule. Returned: success Sample: |
|
Security groups the instance is in. Returned: success Sample: |
|
Name of the service offering the instance has. Returned: success Sample: |
|
Name of SSH key deployed to instance. Returned: success Sample: |
|
State of the instance. Returned: success Sample: |
|
List of resource tags associated with the instance. Returned: success Sample: |
|
Name of template the instance was deployed with. Returned: success Sample: |
|
List of dictionaries of the volumes attached to the instance. Returned: success Sample: |
|
Name of zone the instance is in. Returned: success Sample: |