Note
This plugin is part of the cloudscale_ch.cloud collection.
To install it use: ansible-galaxy collection install cloudscale_ch.cloud.
To use it in a playbook, specify: cloudscale_ch.cloud.server_group.
New in version 1.0.0: of cloudscale_ch.cloud
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| api_timeout integer | Default: 30 | Timeout in seconds for calls to the cloudscale.ch API. |
| api_token string / required | cloudscale.ch API token. This can also be passed in the CLOUDSCALE_API_TOKEN environment variable. | |
| name string | Name of the server group. Either name or uuid is required. These options are mutually exclusive. | |
| state string |
| State of the server group. |
| tags dictionary | Tags assosiated with the server groups. Set this to {} to clear any tags. | |
| type string | Default: "anti-affinity" | Type of the server group. |
| uuid string | UUID of the server group. Either name or uuid is required. These options are mutually exclusive. | |
| zone string | Zone slug of the server group (e.g. lgp1 or rma1). |
Note
CLOUDSCALE_API_TOKEN environment variable can be used.---
- name: Ensure server group exists
cloudscale_ch.cloud.server_group:
name: my-name
type: anti-affinity
api_token: xxxxxx
- name: Ensure server group in a specific zone
cloudscale_ch.cloud.server_group:
name: my-rma-group
type: anti-affinity
zone: lpg1
api_token: xxxxxx
- name: Ensure a server group is absent
cloudscale_ch.cloud.server_group:
name: my-name
state: absent
api_token: xxxxxx
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
| href string | if available | API URL to get details about this server group Sample: https://api.cloudscale.ch/v1/server-group/cfde831a-4e87-4a75-960f-89b0148aa2cc |
| name string | always | The display name of the server group Sample: load balancers |
| servers list / elements=string | if available | A list of servers that are part of the server group. |
| state string | always | State of the server group. Sample: present |
| tags dictionary | success | Tags assosiated with the server group. Sample: {'project': 'my project'} |
| type string | if available | The type the server group Sample: anti-affinity |
| uuid string | always | The unique identifier for this server Sample: cfde831a-4e87-4a75-960f-89b0148aa2cc |
| zone dictionary | success | The zone of the server group Sample: {'slug': 'rma1'} |
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/cloudscale_ch/cloud/server_group_module.html