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 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_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 API Endpoint for the Hetzner Cloud.

You can also set this option by using the HCLOUD_ENDPOINT environment variable.

Default: "https://api.hetzner.cloud/v1"

api_token

string / required

The API Token for the Hetzner Cloud.

You can also set this option by using the HCLOUD_TOKEN environment variable.

ip

string

The IP the Load Balancer should have.

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:

  • "absent"

  • "present" ← (default)

See Also

See also

Documentation for Hetzner Cloud API

Complete reference for the Hetzner Cloud API.

Examples

- name: Create a basic Load Balancer network
  hetzner.hcloud.load_balancer_network:
    network: my-network
    load_balancer: my-LoadBalancer
    state: present

- name: Create a Load Balancer network and specify the ip address
  hetzner.hcloud.load_balancer_network:
    network: my-network
    load_balancer: my-LoadBalancer
    ip: 10.0.0.1
    state: present

- name: Ensure the Load Balancer network is absent (remove if needed)
  hetzner.hcloud.load_balancer_network:
    network: my-network
    load_balancer: my-LoadBalancer
    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

complex

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: "10.0.0.8"

load_balancer

string

Name of the Load Balancer

Returned: always

Sample: "my-LoadBalancer"

network

string

Name of the Network

Returned: always

Sample: "my-network"

Authors

  • Lukas Kaemmerling (@lkaemmerling)