hetzner.hcloud.load_balancer_network module – Manage the relationship between Hetzner Cloud Networks and Load Balancers
Note
This module is part of the hetzner.hcloud collection (version 6.9.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.load_balancer_network.
New in hetzner.hcloud 0.1.0
Synopsis
- Create and delete the relationship Hetzner Cloud Networks and Load Balancers
Aliases: hcloud_load_balancer_network
Requirements
The below requirements are needed on the host that executes this module.
- python-dateutil >= 2.7.5
- requests >=2.20
Parameters
Parameter | Comments |
|---|---|
api_endpoint aliases: endpoint string | The endpoint for the Hetzner Cloud API. You can also set this option by using the Default: |
api_endpoint_hetzner string | The endpoint for the Hetzner API. You can also set this option by using the Default: |
api_token string / required | The token for the Hetzner Cloud API. You can also set this option by using the |
ip string | The IP the Load Balancer should have. |
ip_range string | IP range in CIDR block notation of the subnet to attach to. |
load_balancer string / required | Name or ID of the Hetzner Cloud Load Balancer. |
network string / required | Name or ID of the Hetzner Cloud Networks. |
state string | State of the load_balancer_network. Choices:
|
See Also
See also
- Documentation for Hetzner APIs
-
Complete reference for the Hetzner APIs.
Examples
- name: Create a basic Load Balancer network
hetzner.hcloud.load_balancer_network:
load_balancer: my-LoadBalancer
network: my-network
state: present
- name: Create a Load Balancer network and specify the subnet
hetzner.hcloud.load_balancer_network:
load_balancer: my-LoadBalancer
network: my-network
ip_range: 10.1.0.0/24
state: present
- name: Create a Load Balancer network and specify the ip address
hetzner.hcloud.load_balancer_network:
load_balancer: my-LoadBalancer
network: my-network
ip: 10.0.0.1
state: present
- name: Ensure the Load Balancer network is absent (remove if needed)
hetzner.hcloud.load_balancer_network:
load_balancer: my-LoadBalancer
network: my-network
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
hcloud_load_balancer_network dictionary | The relationship between a Load Balancer and a network Returned: always |
|
ip string |
IP of the Load Balancer within the Network ip range Returned: always Sample: |
|
load_balancer string |
Name of the Load Balancer Returned: always Sample: |
|
network string |
Name of the Network Returned: always Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/hetzner/hcloud/load_balancer_network_module.html