cloudscale_ch.cloud.load_balancer_pool module – Manages load balancer pools on the cloudscale.ch IaaS service
Note
This module is part of the cloudscale_ch.cloud collection (version 2.3.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 cloudscale\_ch.cloud
.
To use it in a playbook, specify: cloudscale_ch.cloud.load_balancer_pool
.
New in cloudscale_ch.cloud 2.3.0
Synopsis
Get, create, update, delete pools on the cloudscale.ch IaaS service.
Parameters
Parameter |
Comments |
---|---|
The algorithm according to which the incoming traffic is distributed between the pool members. See the [API documentation](https://www.cloudscale.ch/en/api/v1#pool-algorithms) for supported distribution algorithms. |
|
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: |
|
UUID of the load balancer for this pool. |
|
Name of the load balancer pool. |
|
The protocol used for traffic between the load balancer and the pool members. See the [API documentation](https://www.cloudscale.ch/en/api/v1#pool-protocols) for supported protocols. |
|
State of the load balancer pool. Choices:
|
|
Tags assosiated with the load balancer. Set this to |
|
UUID of the load balancer pool. Either name or uuid are required. |
Notes
Note
If uuid option is provided, it takes precedence over name for pool selection. This allows to update the load balancer pool’s name.
If no uuid option is provided, name is used for pool selection. If more than one pool 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 pool for a load balancer using registered variables
- name: Create a running load balancer
cloudscale_ch.cloud.load_balancer:
name: 'lb1'
flavor: 'lb-standard'
zone: 'lpg1'
tags:
project: ansible-test
stage: production
sla: 24-7
api_token: xxxxxx
register: load_balancer
- name: Create a load balancer pool
cloudscale_ch.cloud.load_balancer_pool:
name: 'swimming-pool'
load_balancer: '{{ load_balancer.uuid }}'
algorithm: 'round_robin'
protocol: 'tcp'
tags:
project: ansible-test
stage: production
sla: 24-7
api_token: xxxxxx
register: load_balancer_pool
# Create a load balancer pool with algorithm: round_robin and protocol: tcp
- name: Create a load balancer pool
cloudscale_ch.cloud.load_balancer_pool:
name: 'cloudscale-loadbalancer-pool1'
load_balancer: '3766c579-3012-4a85-8192-2bbb4ef85b5f'
algorithm: 'round_robin'
protocol: 'tcp'
tags:
project: ansible-test
stage: production
sla: 24-7
api_token: xxxxxx
# Get load balancer pool facts by name
- name: Get facts of a load balancer pool
cloudscale_ch.cloud.load_balancer_pool:
name: cloudscale-loadbalancer-pool1
api_token: xxxxxx
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The algorithm according to which the incoming traffic is distributed between the pool members Returned: success Sample: |
|
The creation date and time of the load balancer pool Returned: success when not state == absent Sample: |
|
API URL to get details about this load balancer Returned: success when not state == absent Sample: |
|
The load balancer this pool is connected to Returned: success when not state == absent Sample: |
|
The display name of the load balancer pool Returned: success Sample: |
|
The protocol used for traffic between the load balancer and the pool members Returned: success Sample: |
|
The current state of the load balancer pool Returned: success Sample: |
|
Tags assosiated with the load balancer Returned: success Sample: |
|
The unique identifier for this load balancer pool Returned: success Sample: |