On this page
hetzner.hcloud.hcloud_load_balancer_info – Gather infos about your Hetzner Cloud Load Balancers.
Note
This plugin 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_info
.
Synopsis
- Gather infos about your Hetzner Cloud Load Balancers..
Requirements
The below requirements are needed on the host that executes this module.
- hcloud-python >= 1.0.0
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
api_token
string / required
|
This is the API Token for the Hetzner Cloud.
|
|
endpoint
string
|
Default:
"https://api.hetzner.cloud/v1"
|
This is the API Endpoint for the Hetzner Cloud.
|
id
integer
|
The ID of the Load Balancers you want to get.
|
|
label_selector
string
|
The label selector for the Load Balancers you want to get.
|
|
name
string
|
The name of the Load Balancers you want to get.
|
See Also
See also
- Documentation for Hetzner Cloud API
-
Complete reference for the Hetzner Cloud API.
Examples
- name: Gather hcloud load_balancer infos
hcloud_load_balancer_info:
register: output
- name: Print the gathered infos
debug:
var: output
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description | ||||
---|---|---|---|---|---|---|
hcloud_load_balancer_info
complex
|
always |
The load_balancer infos as list
|
||||
delete_protection
boolean
|
always |
True if Load Balancer is protected for deletion
|
||||
disable_public_interface
boolean
|
always |
True if Load Balancer public interface is disabled
|
||||
id
integer
|
always |
Numeric identifier of the Load Balancer
Sample:
1937415
|
||||
ipv4_address
string
|
always |
Public IPv4 address of the Load Balancer
Sample:
116.203.104.109
|
||||
ipv6_address
string
|
always |
Public IPv6 address of the Load Balancer
Sample:
2a01:4f8:1c1c:c140::1
|
||||
labels
dictionary
|
always |
User-defined labels (key-value pairs)
|
||||
load_balancer_type
string
|
always |
Name of the Load Balancer type of the Load Balancer
Sample:
cx11
|
||||
location
string
|
always |
Name of the location of the Load Balancer
Sample:
fsn1
|
||||
name
string
|
always |
Name of the Load Balancer
Sample:
my-Load-Balancer
|
||||
services
complex
|
Always |
all services from this Load Balancer
|
||||
destination_port
integer
|
always |
The port traffic is forwarded to, i.e. the port the targets are listening and accepting connections on.
Sample:
80
|
||||
health_check
complex
|
always |
Configuration for health checks
|
||||
http
complex
|
always |
Additional Configuration of health checks with protocol http/https
|
||||
domain
string
|
always |
Domain we will set within the HTTP HOST header
Sample:
example.com
|
||||
path
string
|
always |
Path we will try to access
Sample:
/
|
||||
response
string
|
always |
Response we expect, if response is not within the health check response the target is unhealthy
|
||||
status_codes
list / elements=string
|
always |
List of HTTP status codes we expect to get when we perform the health check.
Sample:
['2??', '3??']
|
||||
tls
boolean
|
always |
Verify the TLS certificate, only available if health check protocol is https
|
||||
interval
integer
|
always |
Interval of health checks, in seconds
Sample:
15
|
||||
port
integer
|
always |
Port the health check will be performed on
Sample:
80
|
||||
protocol
string
|
always |
Protocol the health checks will be performed over
Sample:
http
|
||||
retries
integer
|
always |
Number of retries until a target is marked as unhealthy
Sample:
3
|
||||
timeout
integer
|
always |
Timeout of health checks, in seconds
Sample:
10
|
||||
http
complex
|
always |
Configuration for HTTP and HTTPS services
|
||||
certificates
list / elements=string
|
always |
List of Names or IDs of certificates
|
||||
cookie_lifetime
integer
|
always |
Lifetime of the cookie which will be set when you enable sticky sessions, in seconds
Sample:
3600
|
||||
cookie_name
string
|
always |
Name of the cookie which will be set when you enable sticky sessions
Sample:
HCLBSTICKY
|
||||
redirect_http
boolean
|
always |
Redirect Traffic from Port 80 to Port 443, only available if protocol is https
|
||||
sticky_sessions
boolean
|
always |
Enable or disable sticky_sessions
Sample:
True
|
||||
listen_port
integer
|
always |
The port the service listens on, i.e. the port users can connect to.
Sample:
443
|
||||
protocol
string
|
always |
Protocol of the service
Sample:
http
|
||||
proxyprotocol
boolean
|
always |
Enable the PROXY protocol.
|
||||
status
string
|
always |
Status of the Load Balancer
Sample:
running
|
||||
targets
complex
|
always |
The targets of the Load Balancer
|
||||
ip
string
|
if type is ip |
IP of the dedicated server
Sample:
127.0.0.1
|
||||
label_selector
string
|
if type is label_selector |
Label Selector
Sample:
application=backend
|
||||
load_balancer
string
|
always |
Name of the Load Balancer
Sample:
my-LoadBalancer
|
||||
server
string
|
if type is server |
Name of the Server
Sample:
my-server
|
||||
type
string
|
always |
Type of the Load Balancer Target
Sample:
server
|
||||
use_private_ip
boolean
|
always |
Route the traffic over the private IP of the Load Balancer through a Hetzner Cloud Network.
Load Balancer needs to be attached to a network. See hetzner.hcloud.hcloud.hcloud_load_balancer_network
Sample:
True
|
Authors
- Lukas Kaemmerling (@LKaemmerling)
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/hetzner/hcloud/hcloud_load_balancer_info_module.html