ngine_io / ngine_io.cloudstack / 2.3.0 / module / cs_instance_info Gathering information from the API of instances from Apache CloudStack based clouds. | "added in version" 0.1.0 of ngine_io.cloudstack" Authors: René Moser (@resmo)ngine_io.cloudstack.cs_instance_info (2.3.0) — module
Install with ansible-galaxy collection install ngine_io.cloudstack:==2.3.0
collections: - name: ngine_io.cloudstack version: 2.3.0
Gathering information from the API of an instance.
- 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
host: description: - Filter by host name. type: str version_added: 2.2.0 version_added_collection: ngine_io.cloudstack name: description: - Name or display name of the instance. - If not specified, all instances are returned required: false type: str domain: description: - Domain the instance is related to. type: str account: description: - Account the instance is related to. type: str api_key: description: - API key of the CloudStack API. - If not given, the C(CLOUDSTACK_KEY) env variable is considered. required: true type: str api_url: description: - URL of the CloudStack API e.g. https://cloud.example.com/client/api. - If not given, the C(CLOUDSTACK_ENDPOINT) env variable is considered. required: true type: str project: description: - Project the instance is related to. type: str api_secret: description: - Secret key of the CloudStack API. - If not set, the C(CLOUDSTACK_SECRET) env variable is considered. required: true type: str api_timeout: default: 10 description: - HTTP timeout in seconds. - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered. type: int api_http_method: choices: - get - post default: get description: - HTTP method used to query the API endpoint. - If not given, the C(CLOUDSTACK_METHOD) env variable is considered. type: str api_verify_ssl_cert: description: - Verify CA authority cert file. - If not given, the C(CLOUDSTACK_VERIFY) env variable is considered. type: str
instances: contains: account: description: Account the instance is related to. returned: success sample: example account type: str affinity_groups: description: Affinity groups the instance is in. returned: success sample: '[ "webservers" ]' type: list created: description: Date of the instance was created. returned: success sample: 2014-12-01T14:57:57+0100 type: str default_ip: description: Default IP address of the instance. returned: success sample: 10.23.37.42 type: str display_name: description: Display name of the instance. returned: success sample: web-01 type: str domain: description: Domain the instance is related to. returned: success sample: example domain type: str group: description: Group name of the instance is related. returned: success sample: web type: str host: description: Host the instance is running on. returned: success and instance is running sample: host01.example.com type: str hypervisor: description: Hypervisor related to this instance. returned: success sample: KVM type: str id: description: UUID of the instance. returned: success sample: 04589590-ac63-4ffc-93f5-b698b8ac38b6 type: str instance_name: description: Internal name of the instance (ROOT admin only). returned: success sample: i-44-3992-VM type: str iso: description: Name of ISO the instance was deployed with. returned: success sample: Debian-8-64bit type: str name: description: Name of the instance. returned: success sample: web-01 type: str nic: contains: broadcasturi: description: The broadcast uri of the nic. returned: success sample: vlan://2250 type: str gateway: description: The gateway of the nic. returned: success sample: 10.1.2.1 type: str id: description: The ID of the nic. returned: success sample: 5dc74fa3-2ec3-48a0-9e0d-6f43365336a9 type: str ipaddress: description: The ip address of the nic. returned: success sample: 10.1.2.3 type: str isdefault: description: True if nic is default, false otherwise. returned: success sample: true type: bool isolationuri: description: The isolation uri of the nic. returned: success sample: vlan://2250 type: str macaddress: description: The mac address of the nic. returned: success sample: 06:a2:03:00:08:12 type: str netmask: description: The netmask of the nic. returned: success sample: 255.255.255.0 type: str networkid: description: The ID of the corresponding network. returned: success sample: 432ce27b-c2bb-4e12-a88c-a919cd3a3017 type: str networkname: description: The name of the corresponding network. returned: success sample: network1 type: str traffictype: description: The traffic type of the nic. returned: success sample: Guest type: str type: description: The type of the network. returned: success sample: Shared type: str description: List of dictionaries of the instance nics. returned: success type: complex password: description: The password of the instance if exists. returned: success sample: Ge2oe7Do type: str password_enabled: description: True if password setting is enabled. returned: success sample: true type: bool project: description: Name of project the instance is related to. returned: success sample: Production type: str public_ip: description: Public IP address with instance via static NAT rule. returned: success sample: 1.2.3.4 type: str security_groups: description: Security groups the instance is in. returned: success sample: '[ "default" ]' type: list service_offering: description: Name of the service offering the instance has. returned: success sample: 2cpu_2gb type: str ssh_key: description: Name of SSH key deployed to instance. returned: success sample: key@work type: str state: description: State of the instance. returned: success sample: Running type: str tags: description: List of resource tags associated with the instance. returned: success sample: '[ { "key": "foo", "value": "bar" } ]' type: list template: description: Name of template the instance was deployed with. returned: success sample: Debian-8-64bit type: str volumes: description: List of dictionaries of the volumes attached to the instance. returned: success sample: '[ { name: "ROOT-1369", type: "ROOT", size: 10737418240 }, { name: "data01, type: "DATADISK", size: 10737418240 } ]' type: list zone: description: Name of zone the instance is in. returned: success sample: ch-gva-2 type: str description: A list of matching instances. returned: success type: list