cloudscale_ch.cloud.load_balancer module – Manages load balancers 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
.
New in cloudscale_ch.cloud 2.3.0
Synopsis
Get, create, update, delete load balancers on the cloudscale.ch IaaS service.
Parameters
Parameter |
Comments |
---|---|
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: |
|
Flavor of the load balancer. Default: |
|
Name of the load balancer. Either name or uuid are required. |
|
State of the load balancer. Choices:
|
|
Tags assosiated with the load balancer. Set this to |
|
UUID of the load balancer. Either name or uuid are required. |
|
See the [API documentation](https://www.cloudscale.ch/en/api/v1#vip_addresses-attribute-specification) for details about this parameter. |
|
Use this address. Must be in the same range as subnet. If empty, a radom address will be used. |
|
Create a VIP address on the subnet identified by this UUID. |
|
Zone in which the load balancer resides (e.g. |
Notes
Note
If uuid option is provided, it takes precedence over name for load balancer selection. This allows to update the load balancers’s name.
If no uuid option is provided, name is used for load balancer 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 and start a load balancer
- name: Start cloudscale.ch load balancer
cloudscale_ch.cloud.load_balancer:
name: my-shiny-cloudscale-load-balancer
flavor: lb-standard
zone: rma1
tags:
project: my project
api_token: xxxxxx
# Create and start a load balancer with specific subnet
- name: Start cloudscale.ch load balancer
cloudscale_ch.cloud.load_balancer:
name: my-shiny-cloudscale-load-balancer
flavor: lb-standard
vip_addresses:
- subnet: d7b82c9b-5900-436c-9296-e94dca01c7a0
address: 172.25.12.1
zone: lpg1
tags:
project: my project
api_token: xxxxxx
# Get load balancer facts by name
- name: Get facts of a load balancer
cloudscale_ch.cloud.load_balancer:
name: my-shiny-cloudscale-load-balancer
api_token: xxxxxx
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The creation date and time of the load balancer Returned: success when not state == absent Sample: |
|
The flavor that has been used for this load balancer Returned: success when not state == absent Sample: |
|
API URL to get details about this load balancer Returned: success when not state == absent Sample: |
|
The display name of the load balancer Returned: success Sample: |
|
The current state of the load balancer Returned: success Sample: |
|
The current operational status of the load balancer Returned: success Sample: |
|
Tags assosiated with the load balancer Returned: success Sample: |
|
The unique identifier for this load balancer Returned: success Sample: |
|
List of vip_addresses for this load balancer Returned: success when not state == absent Sample: |
|
The zone used for this load balancer Returned: success when not state == absent Sample: |