cloudscale_ch.cloud.load_balancer_listener module – Manages load balancer listeners on the cloudscale.ch IaaS service
Note
This module is part of the cloudscale_ch.cloud collection (version 2.4.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 cloudscale_ch.cloud
.
To use it in a playbook, specify: cloudscale_ch.cloud.load_balancer_listener
.
New in cloudscale_ch.cloud 2.3.0
Synopsis
Get, create, update, delete listeners on the cloudscale.ch IaaS service.
Parameters
Parameter |
Comments |
---|---|
Restrict the allowed source IPs for this listener. Empty means that any source IP is allowed. If the list is non-empty, traffic from source IPs not included is denied. |
|
Timeout in seconds for calls to the cloudscale.ch API. This can also be passed in the Default: |
|
cloudscale.ch API token. This can also be passed in the |
|
cloudscale.ch API URL. This can also be passed in the Default: |
|
Name of the load balancer listener. Either name or uuid are required. |
|
The pool of the listener. |
|
The protocol used for receiving traffic. |
|
The port on which traffic is received. |
|
State of the load balancer listener. Choices:
|
|
Tags assosiated with the load balancer. Set this to |
|
Client inactivity timeout in milliseconds. |
|
Pool member connection timeout in milliseconds. |
|
Pool member inactivity timeout in milliseconds. |
|
UUID of the load balancer listener. Either name or uuid are required. |
Notes
Note
If uuid option is provided, it takes precedence over name for load balancer listener selection. This allows to update the listener’s name.
If no uuid option is provided, name is used for load balancer listener selection.
If more than one load balancer with this name exists, execution is aborted.
All operations are performed using the cloudscale.ch public API v1.
For details consult the full API documentation: https://www.cloudscale.ch/en/api/v1.
A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at https://control.cloudscale.ch.
Examples
# Create a load balancer listener for a pool using registered variables
- name: Create a load balancer pool
cloudscale_ch.cloud.load_balancer_pool:
name: 'swimming-pool'
load_balancer: '3d41b118-f95c-4897-ad74-2260fea783fc'
algorithm: 'round_robin'
protocol: 'tcp'
api_token: xxxxxx
register: load_balancer_pool
- name: Create a load balancer listener
cloudscale_ch.cloud.load_balancer_listener:
name: 'swimming-pool-listener'
pool: '{{ load_balancer_pool.uuid }}'
protocol: 'tcp'
protocol_port: 8080
tags:
project: ansible-test
stage: production
sla: 24-7
api_token: xxxxxx
# Create a load balancer listener for a pool with restriction
- name: Create a load balancer listener with ip restriction
cloudscale_ch.cloud.load_balancer_listener:
name: 'new-listener2'
pool: '618a6cc8-d757-4fab-aa10-d49dc47e667b'
protocol: 'tcp'
protocol_port: 8080
allowed_cidrs:
- '192.168.3.0/24'
- '2001:db8:85a3:8d3::/64'
tags:
project: ansible-test
stage: production
sla: 24-7
api_token: xxxxxx
# Get load balancer listener facts by name
- name: Get facts of a load balancer listener by name
cloudscale_ch.cloud.load_balancer_listener:
name: '{{ cloudscale_resource_prefix }}-test'
api_token: xxxxxx
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Restrict the allowed source IPs for this listener Returned: success when not state == absent Sample: |
|
The creation date and time of the load balancer listener Returned: success when not state == absent Sample: |
|
API URL to get details about this load balancer lintener Returned: success when not state == absent Sample: |
|
The display name of the load balancer listener Returned: success Sample: |
|
The pool of the load balancer listener Returned: success when not state == absent |
|
API URL to get details about the pool. Returned: success Sample: |
|
The name of the pool. Returned: success Sample: |
|
The unique identifier for the pool. Returned: success Sample: |
|
The protocol used for receiving traffic Returned: success when not state == absent Sample: |
|
The port on which traffic is received Returned: success when not state == absent Sample: |
|
Tags assosiated with the load balancer listener Returned: success Sample: |
|
Client inactivity timeout in milliseconds Returned: success when not state == absent Sample: |
|
Pool member connection timeout in milliseconds Returned: success when not state == absent Sample: |
|
Pool member inactivity timeout in milliseconds Returned: success when not state == absent Sample: |
|
The unique identifier for this load balancer listener Returned: success Sample: |