hetzner.hcloud.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 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_load_balancer
.
New in version 0.1.0: of hetzner.hcloud
Requirements
The below requirements are needed on the host that executes this module.
hcloud-python >= 1.0.0
hcloud-python >= 1.8.0
Parameters
Parameter |
Comments |
---|---|
This is the API Token for the Hetzner Cloud. |
|
Protect the Load Balancer for deletion. Choices:
|
|
Disables the public interface. Choices:
|
|
This is the API Endpoint for the Hetzner Cloud. Default: “https://api.hetzner.cloud/v1” |
|
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 exists. |
|
Location of Load Balancer. Required if no network_zone is given and Load Balancer does not exists. |
|
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 exists. |
|
Network Zone of Load Balancer. Required of no location is given and Load Balancer does not exists. |
|
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
hcloud_load_balancer:
name: my-Load Balancer
load_balancer_type: lb11
location: fsn1
state: present
- name: Ensure the Load Balancer is absent (remove if needed)
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 |
|
True if Load Balancer is protected for deletion Returned: always Sample: false |
|
True if Load Balancer public interface is disabled Returned: always Sample: false |
|
Numeric identifier of the Load Balancer Returned: always Sample: 1937415 |
|
Public IPv4 address of the Load Balancer Returned: always Sample: “116.203.104.109” |
|
Public IPv6 address of the Load Balancer Returned: always Sample: “2a01:4f8:1c1c:c140::1” |
|
User-defined labels (key-value pairs) Returned: always |
|
Name of the Load Balancer type of the Load Balancer Returned: always Sample: “cx11” |
|
Name of the location of the Load Balancer Returned: always Sample: “fsn1” |
|
Name of the Load Balancer Returned: always Sample: “my-Load-Balancer” |
|
Status of the Load Balancer Returned: always Sample: “running” |
Authors
Lukas Kaemmerling (@LKaemmerling)