cloudscale_ch.cloud.load_balancer_health_monitor module – Manages load balancers 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_health_monitor
.
New in cloudscale_ch.cloud 2.3.0
Synopsis
Get, create, update, delete health monitors 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: |
|
The delay between two successive checks in seconds. |
|
The number of checks that need to fail before the monitor_status of a pool member changes to “down”. |
|
Advanced options for health monitors with type “http” or “https”. |
|
The HTTP status codes allowed for a check to be considered successful. See the [API documentation](https://www.cloudscale.ch/en/api/v1#http-attribute-specification) for details. |
|
The server name in the HTTP Host header used for the check. Requires version to be set to “1.1”. |
|
The HTTP method used for the check. |
|
The URL used for the check. |
|
The HTTP version used for the check. |
|
The pool of the health monitor. |
|
State of the load balancer health monitor. Choices:
|
|
Tags assosiated with the load balancer. Set this to |
|
The maximum time allowed for an individual check in seconds. |
|
The type of the health monitor. See the [API documentation](https://www.cloudscale.ch/en/api/v1#create-a-health-monitor) for allowed options. |
|
The number of checks that need to be successful before the monitor_status of a pool member changes to “up”. |
|
UUID of the load balancer health monitor. |
Notes
Note
Health monitors do not have names. uuid‘s are used to reference a health monitors.
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 simple health monitor for a pool
- 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 health monitor (ping)
cloudscale_ch.cloud.load_balancer_health_monitor:
pool: '{{ load_balancer_pool.uuid }}'
type: 'ping'
api_token: xxxxxx
register: load_balancer_health_monitor
# Get load balancer health monitor facts by UUID
- name: Get facts of a load balancer health monitor by UUID
cloudscale_ch.cloud.load_balancer_health_monitor:
uuid: '{{ load_balancer_health_monitor.uuid }}'
api_token: xxxxxx
# Update a health monitor
- name: Update HTTP method of a load balancer health monitor from GET to CONNECT
cloudscale_ch.cloud.load_balancer_health_monitor:
uuid: '{{ load_balancer_health_monitor_http.uuid }}'
delay_s: 2
timeout_s: 1
up_threshold: 2
down_threshold: 3
type: 'http'
http:
expected_codes:
- 200
- 202
method: 'CONNECT'
url_path: '/'
version: '1.1'
host: 'host1'
tags:
project: ansible-test
stage: production
sla: 24-7
api_token: xxxxxx
register: load_balancer_health_monitor
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 health monitor Returned: success when not state == absent Sample: |
|
The delay between two successive checks in seconds Returned: success when not state == absent Sample: |
|
The number of checks that need to fail before the monitor_status of a pool member changes to “down” Returned: success when not state == absent Sample: |
|
API URL to get details about this load balancer health monitor Returned: success when not state == absent Sample: |
|
Advanced options for health monitors with type “http” or “https” Returned: success when not state == absent Sample: |
|
The pool of the health monitor Returned: success when not state == absent Sample: |
|
Tags assosiated with the load balancer Returned: success Sample: |
|
The maximum time allowed for an individual check in seconds Returned: success when not state == absent Sample: |
|
The type of the health monitor Returned: success when not state == absent |
|
The number of checks that need to be successful before the monitor_status of a pool member changes to “up” Returned: success when not state == absent Sample: |
|
The unique identifier for this load balancer health monitor Returned: success Sample: |