hetzner.hcloud.load_balancer module – Create and manage cloud Load Balancers on the Hetzner Cloud.
Note
This module is part of the hetzner.hcloud collection (version 4.2.1).
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
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: hetzner.hcloud.load_balancer
.
New in hetzner.hcloud 0.1.0
Synopsis
Create, update and manage cloud Load Balancers on the Hetzner Cloud.
Aliases: hcloud_load_balancer
Requirements
The below requirements are needed on the host that executes this module.
python-dateutil >= 2.7.5
requests >=2.20
Parameters
Parameter |
Comments |
---|---|
Algorithm of the Load Balancer. Choices:
|
|
The API Endpoint for the Hetzner Cloud. You can also set this option by using the Default: |
|
The API Token for the Hetzner Cloud. You can also set this option by using the |
|
Protect the Load Balancer for deletion. Choices:
|
|
Disables the public interface. Choices:
|
|
The ID of the Hetzner Cloud Load Balancer to manage. Only required if no Load Balancer name is given |
|
User-defined labels (key-value pairs). |
|
The Load Balancer Type of the Hetzner Cloud Load Balancer to manage. Required if Load Balancer does not exist. |
|
Location of Load Balancer. Required if no network_zone is given and Load Balancer does not exist. |
|
The Name of the Hetzner Cloud Load Balancer to manage. Only required if no Load Balancer id is given or a Load Balancer does not exist. |
|
Network Zone of Load Balancer. Required of no location is given and Load Balancer does not exist. |
|
State of the Load Balancer. Choices:
|
See Also
See also
- Documentation for Hetzner Cloud API
Complete reference for the Hetzner Cloud API.
Examples
- name: Create a basic Load Balancer
hetzner.hcloud.load_balancer:
name: my-Load Balancer
load_balancer_type: lb11
algorithm: round_robin
location: fsn1
state: present
- name: Ensure the Load Balancer is absent (remove if needed)
hetzner.hcloud.load_balancer:
name: my-Load Balancer
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The Load Balancer instance Returned: Always |
|
Algorithm of the Load Balancer. Returned: always Can only return:
Sample: |
|
True if Load Balancer is protected for deletion Returned: always Sample: |
|
True if Load Balancer public interface is disabled Returned: always Sample: |
|
Numeric identifier of the Load Balancer Returned: always Sample: |
|
Public IPv4 address of the Load Balancer Returned: always Sample: |
|
Public IPv6 address of the Load Balancer Returned: always Sample: |
|
User-defined labels (key-value pairs) Returned: always |
|
Name of the Load Balancer type of the Load Balancer Returned: always Sample: |
|
Name of the location of the Load Balancer Returned: always Sample: |
|
Name of the Load Balancer Returned: always Sample: |