hetzner.hcloud.hcloud_placement_group – Create and manage placement groups on the Hetzner Cloud.

Note

This plugin is part of the hetzner.hcloud collection (version 1.6.0).

To install it use: ansible-galaxy collection install hetzner.hcloud.

To use it in a playbook, specify: hetzner.hcloud.hcloud_placement_group.

Synopsis

  • Create, update and manage placement groups on the Hetzner Cloud.

Requirements

The below requirements are needed on the host that executes this module.

  • hcloud-python >= 1.0.0

  • hcloud-python >= 1.15.0

Parameters

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
    Choices:
  • absent
  • present ←
State of the placement group.
type
string
The Type of the Hetzner Cloud placement group.

See Also

See also

Documentation for Hetzner Cloud API

Complete reference for the Hetzner Cloud API.

Examples

- 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

Return Values

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


Authors

  • Adrian Huber (@Adi146)