Note
This plugin is part of the hetzner.hcloud collection (version 1.6.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 hetzner.hcloud
.
To use it in a playbook, specify: hetzner.hcloud.hcloud_placement_group
.
The below requirements are needed on the host that executes this module.
Parameter | Choices/Defaults | Comments |
---|---|---|
api_token string / required | This is the API Token for the Hetzner Cloud. | |
endpoint string | Default: "https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
id integer | The ID of the Hetzner Cloud placement group to manage. Only required if no placement group name is given | |
labels dictionary | User-defined labels (key-value pairs) | |
name string | The Name of the Hetzner Cloud placement group to manage. Only required if no placement group id is given, or a placement group does not exists. | |
state string |
| State of the placement group. |
type string | The Type of the Hetzner Cloud placement group. |
See also
Complete reference for the Hetzner Cloud API.
- name: Create a basic placement group hcloud_placement_group: name: my-placement-group state: present type: spread - name: Create a placement group with labels hcloud_placement_group: name: my-placement-group type: spread labels: key: value mylabel: 123 state: present - name: Ensure the placement group is absent (remove if needed) hcloud_placement_group: name: my-placement-group state: absent
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description | |
---|---|---|---|
hcloud_placement_group complex | Always | The placement group instance | |
id integer | always | Numeric identifier of the placement group Sample: 1937415 | |
labels dictionary | always | User-defined labels (key-value pairs) | |
name string | always | Name of the placement group Sample: my placement group | |
servers list / elements=integer | always | Server IDs of the placement group Sample: [4711, 4712] | |
type string | always | Type of the placement group Sample: spread |
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/hetzner/hcloud/hcloud_placement_group_module.html