New in version 2.0.
The below requirements are needed on the host that executes this module.
Parameter |
Choices/Defaults |
Comments |
---|---|---|
alias
required |
|
The alias of your CLC Account
|
description
|
|
A description for the loadbalancer
|
location
required |
|
The location of the datacenter where the load balancer resides in
|
method
|
|
-The balancing method for the load balancer pool
|
name
required |
|
The name of the loadbalancer
|
nodes
|
Default:
[]
|
A list of nodes that needs to be added to the load balancer pool
|
persistence
|
|
The persistence method for the load balancer
|
port
|
|
Port to configure on the public-facing side of the load balancer pool
|
state
|
|
Whether to create or delete the load balancer pool
|
status
|
|
The status of the loadbalancer
|
Note
# Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples
- name: Create Loadbalancer
hosts: localhost
connection: local
tasks:
- name: Actually Create things
clc_loadbalancer:
name: test
description: test
alias: TEST
location: WA1
port: 443
nodes:
- ipAddress: 10.11.22.123
privatePort: 80
state: present
- name: Add node to an existing loadbalancer pool
hosts: localhost
connection: local
tasks:
- name: Actually Create things
clc_loadbalancer:
name: test
description: test
alias: TEST
location: WA1
port: 443
nodes:
- ipAddress: 10.11.22.234
privatePort: 80
state: nodes_present
- name: Remove node from an existing loadbalancer pool
hosts: localhost
connection: local
tasks:
- name: Actually Create things
clc_loadbalancer:
name: test
description: test
alias: TEST
location: WA1
port: 443
nodes:
- ipAddress: 10.11.22.234
privatePort: 80
state: nodes_absent
- name: Delete LoadbalancerPool
hosts: localhost
connection: local
tasks:
- name: Actually Delete things
clc_loadbalancer:
name: test
description: test
alias: TEST
location: WA1
port: 443
nodes:
- ipAddress: 10.11.22.123
privatePort: 80
state: port_absent
- name: Delete Loadbalancer
hosts: localhost
connection: local
tasks:
- name: Actually Delete things
clc_loadbalancer:
name: test
description: test
alias: TEST
location: WA1
port: 443
nodes:
- ipAddress: 10.11.22.123
privatePort: 80
state: absent
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
---|---|---|
loadbalancer
dict
|
success |
The load balancer result object from CLC
Sample:
{'status': 'enabled', 'name': 'test-lb', 'links': [{'href': '/v2/sharedLoadBalancers/wfad/wa1/ab5b18cb81e94ab9925b61d1ca043fb5', 'verbs': ['GET', 'PUT', 'DELETE'], 'rel': 'self'}, {'href': '/v2/sharedLoadBalancers/wfad/wa1/ab5b18cb81e94ab9925b61d1ca043fb5/pools', 'verbs': ['GET', 'POST'], 'rel': 'pools'}], 'pools': [], 'ipAddress': '66.150.174.197', 'id': 'ab5b18cb81e94ab9925b61d1ca043fb5', 'description': 'test-lb'}
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Hint
If you notice any issues in this documentation you can edit this document to improve it.