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.16.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
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: hetzner.hcloud.hcloud_load_balancer
.
New in hetzner.hcloud 0.1.0
Synopsis
Create, update and manage cloud Load Balancers on the Hetzner Cloud.
Requirements
The below requirements are needed on the host that executes this module.
hcloud-python >= 1.8.0
python-dateutil >= 2.7.5
requests >=2.20
Parameters
Parameter |
Comments |
---|---|
This is the API Token for the Hetzner Cloud. You can also set this option by using the environment variable HCLOUD_TOKEN |
|
Protect the Load Balancer for deletion. Choices:
|
|
Disables the public interface. Choices:
|
|
This is the API Endpoint for the Hetzner Cloud. Default: |
|
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
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: |
|
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: |
|
Status of the Load Balancer Returned: always Sample: |