ngine_io.cloudstack.cs_host module – Manages hosts on Apache CloudStack based clouds.
Note
This module is part of the ngine_io.cloudstack collection (version 2.5.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_host
.
New in ngine_io.cloudstack 0.1.0
Synopsis
Create, update and remove hosts.
Requirements
The below requirements are needed on the host that executes this module.
python >= 2.6
cs >= 0.9.0
Parameters
Parameter |
Comments |
---|---|
Allocation state of the host. Choices:
|
|
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 |
|
Name of the cluster. |
|
Tags of the host. |
|
Name of the cluster. Required if state=present and host does not yet exist. Possible values are |
|
Name of the host. |
|
Password for the host. Required if state=present and host does not yet exist. |
|
Name of the pod. Required if state=present and host does not yet exist. |
|
State of the host. Choices:
|
|
Url of the host used to create a host. If not provided, Only considered if state=present and host does not yet exist. |
|
Username for the host. Required if state=present and host does not yet exist. |
|
If If not given, the This should only be used on personally controlled sites using self-signed certificates. Choices:
|
|
Name of the zone in which the host should be deployed. |
Notes
Note
A detailed guide about cloudstack modules can be found in the CloudStack Cloud Guide.
This module supports check mode.
Examples
- name: Ensure a host is present but disabled
ngine_io.cloudstack.cs_host:
name: pod01.zone01.example.com
cluster: vcenter.example.com/zone01/cluster01
pod: pod01
zone: zone01
hypervisor: VMware
allocation_state: disabled
host_tags:
- perf
- gpu
- name: Ensure an existing host is disabled
ngine_io.cloudstack.cs_host:
name: pod01.zone01.example.com
zone: zone01
allocation_state: disabled
- name: Ensure an existing host is enabled
ngine_io.cloudstack.cs_host:
name: pod01.zone01.example.com
zone: zone01
allocation_state: enabled
- name: Ensure a host is absent
ngine_io.cloudstack.cs_host:
name: pod01.zone01.example.com
zone: zone01
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Allocation state of the host. Returned: success Sample: |
|
Capabilities of the host. Returned: success Sample: |
|
Cluster of the host. Returned: success Sample: |
|
Type of the cluster of the host. Returned: success Sample: |
|
Amount in percent of the host’s CPU currently allocated. Returned: success Sample: |
|
Number of CPUs of the host. Returned: success Sample: |
|
Number of CPU sockets of the host. Returned: success Sample: |
|
CPU speed in Mhz Returned: success Sample: |
|
Amount of the host’s CPU currently used. Returned: success Sample: |
|
Amount of the host’s CPU after applying the cpu.overprovisioning.factor. Returned: success Sample: |
|
Date when the host was created. Returned: success Sample: |
|
Date when the host was disconnected. Returned: success Sample: |
|
Host’s currently allocated disk size. Returned: success Sample: |
|
Total disk size of the host Returned: success Sample: |
|
Events available for the host Returned: success Sample: |
|
GPU cards present in the host. Returned: success Sample: |
|
Whether the host is a HA host. Returned: success Sample: |
|
Whether the host has enough CPU and RAM capacity to migrate a VM to it. Returned: success Sample: |
|
Comma-separated list of tags for the host. Returned: success Sample: |
|
Type of the host. Returned: success Sample: |
|
Version of the host. Returned: success Sample: |
|
Host’s hypervisor. Returned: success Sample: |
|
Hypervisor version. Returned: success Sample: |
|
IP address of the host Returned: success Sample: |
|
Whether the local storage is available or not. Returned: success Sample: |
|
Date and time the host was last pinged. Returned: success Sample: |
|
Management server ID of the host. Returned: success Sample: |
|
Amount of the host’s memory currently allocated. Returned: success Sample: |
|
Total of memory of the host. Returned: success Sample: |
|
Amount of the host’s memory currently used. Returned: success Sample: |
|
Name of the host. Returned: success Sample: |
|
Incoming network traffic on the host. Returned: success Sample: |
|
Outgoing network traffic on the host. Returned: success Sample: |
|
OS category name of the host. Returned: success Sample: |
|
Host out-of-band management information. Returned: success Sample: |
|
Pod name of the host. Returned: success Sample: |
|
Date and time the host was removed. Returned: success Sample: |
|
Resource state of the host. Returned: success Sample: |
|
State of the host. Returned: success Sample: |
|
Whether this host is suitable (has enough capacity and satisfies all conditions like hosttags, max guests VM limit, etc) to migrate a VM to it or not. Returned: success Sample: |
|
Zone of the host. Returned: success Sample: |