cs_instance_facts - Gathering facts from the API of instances from Apache CloudStack based clouds.
New in version 2.1.
Synopsis
- Gathering facts from the API of an instance.
Requirements (on host that executes module)
- python >= 2.6
- cs >= 0.6.10
Options
parameter | required | default | choices | comments |
---|---|---|---|---|
account | no | Account the instance is related to. | ||
api_http_method | no | get |
| HTTP method used. |
api_key | no | API key of the CloudStack API. | ||
api_region | no | cloudstack | Name of the ini section in the cloustack.ini file. | |
api_secret | no | Secret key of the CloudStack API. | ||
api_timeout | no | 10 | HTTP timeout. | |
api_url | no | URL of the CloudStack API e.g. https://cloud.example.com/client/api. | ||
domain | no | Domain the instance is related to. | ||
name | yes | Name or display name of the instance. | ||
project | no | Project the instance is related to. |
Examples
- cs_instance_facts: name: web-vm-1 delegate_to: localhost - debug: var: cloudstack_instance
Return Values
Common return values are documented here Return Values, the following are the fields unique to this module:
name | description | returned | type | sample |
---|---|---|---|---|
cloudstack_instance.account | Account the instance is related to. | success | string | example account |
cloudstack_instance.affinity_groups | Affinity groups the instance is in. | success | list | [ "webservers" ] |
cloudstack_instance.default_ip | Default IP address of the instance. | success | string | 10.23.37.42 |
cloudstack_instance.display_name | Display name of the instance. | success | string | web-01 |
cloudstack_instance.domain | Domain the instance is related to. | success | string | example domain |
cloudstack_instance.group | Group name of the instance is related. | success | string | web |
cloudstack_instance.hypervisor | Hypervisor related to this instance. | success | string | KVM |
cloudstack_instance.id | UUID of the instance. | success | string | 04589590-ac63-4ffc-93f5-b698b8ac38b6 |
cloudstack_instance.instance_name | Internal name of the instance (ROOT admin only). | success | string | i-44-3992-VM |
cloudstack_instance.iso | Name of ISO the instance was deployed with. | success | string | Debian-8-64bit |
cloudstack_instance.name | Name of the instance. | success | string | web-01 |
cloudstack_instance.password | The password of the instance if exists. | success | string | Ge2oe7Do |
cloudstack_instance.password_enabled | True if password setting is enabled. | success | boolean | True |
cloudstack_instance.project | Name of project the instance is related to. | success | string | Production |
cloudstack_instance.public_ip | Public IP address with instance via static NAT rule. | success | string | 1.2.3.4 |
cloudstack_instance.security_groups | Security groups the instance is in. | success | list | [ "default" ] |
cloudstack_instance.service_offering | Name of the service offering the instance has. | success | string | 2cpu_2gb |
cloudstack_instance.ssh_key | Name of SSH key deployed to instance. | success | string | key@work |
cloudstack_instance.state | State of the instance. | success | string | Running |
cloudstack_instance.tags | List of resource tags associated with the instance. | success | dict | [ { "key": "foo", "value": "bar" } ] |
cloudstack_instance.template | Name of template the instance was deployed with. | success | string | Debian-8-64bit |
cloudstack_instance.volumes | List of dictionaries of the volumes attached to the instance. | success | list | [ { name: "ROOT-1369", type: "ROOT", size: 10737418240 }, { name: "data01, type: "DATADISK", size: 10737418240 } ] |
cloudstack_instance.zone | Name of zone the instance is in. | success | string | ch-gva-2 |
created | Date of the instance was created. | success | string | 2014-12-01T14:57:57+0100 |
Notes
Note
- Ansible uses the
cs
library’s configuration method if credentials are not provided by the argumentsapi_url
,api_key
,api_secret
. Configuration is read from several locations, in the following order. - TheCLOUDSTACK_ENDPOINT
,CLOUDSTACK_KEY
,CLOUDSTACK_SECRET
andCLOUDSTACK_METHOD
.CLOUDSTACK_TIMEOUT
environment variables. - ACLOUDSTACK_CONFIG
environment variable pointing to an.ini
file, - Acloudstack.ini
file in the current working directory. - A.cloudstack.ini
file in the users home directory. Optionally multiple credentials and endpoints can be specified using ini sections incloudstack.ini
. Use the argumentapi_region
to select the section name, default section iscloudstack
. See https://github.com/exoscale/cs for more information. - A detailed guide about cloudstack modules can be found on http://docs.ansible.com/ansible/guide_cloudstack.html
- This module supports check mode.
Status
This module is flagged as stableinterface which means that the maintainers for this module guarantee that no backward incompatible interface changes will be made.
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/cs_instance_facts_module.html