community.general.oneandone_load_balancer – Configure 1&1 load balancer.¶
Note
This plugin is part of the community.general collection (version 2.5.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.oneandone_load_balancer
.
Requirements¶
The below requirements are needed on the host that executes this module.
1and1
python >= 2.6
Parameters¶
Examples¶
- name: Create a load balancer
community.general.oneandone_load_balancer:
auth_token: oneandone_private_api_key
name: ansible load balancer
description: Testing creation of load balancer with ansible
health_check_test: TCP
health_check_interval: 40
persistence: true
persistence_time: 1200
method: ROUND_ROBIN
datacenter: US
rules:
-
protocol: TCP
port_balancer: 80
port_server: 80
source: 0.0.0.0
wait: true
wait_timeout: 500
- name: Destroy a load balancer
community.general.oneandone_load_balancer:
auth_token: oneandone_private_api_key
name: ansible load balancer
wait: true
wait_timeout: 500
state: absent
- name: Update a load balancer
community.general.oneandone_load_balancer:
auth_token: oneandone_private_api_key
load_balancer: ansible load balancer
name: ansible load balancer updated
description: Testing the update of a load balancer with ansible
wait: true
wait_timeout: 500
state: update
- name: Add server to a load balancer
community.general.oneandone_load_balancer:
auth_token: oneandone_private_api_key
load_balancer: ansible load balancer updated
description: Adding server to a load balancer with ansible
add_server_ips:
- server identifier (id or name)
wait: true
wait_timeout: 500
state: update
- name: Remove server from a load balancer
community.general.oneandone_load_balancer:
auth_token: oneandone_private_api_key
load_balancer: ansible load balancer updated
description: Removing server from a load balancer with ansible
remove_server_ips:
- B2504878540DBC5F7634EB00A07C1EBD (server's ip id)
wait: true
wait_timeout: 500
state: update
- name: Add rules to a load balancer
community.general.oneandone_load_balancer:
auth_token: oneandone_private_api_key
load_balancer: ansible load balancer updated
description: Adding rules to a load balancer with ansible
add_rules:
-
protocol: TCP
port_balancer: 70
port_server: 70
source: 0.0.0.0
-
protocol: TCP
port_balancer: 60
port_server: 60
source: 0.0.0.0
wait: true
wait_timeout: 500
state: update
- name: Remove rules from a load balancer
community.general.oneandone_load_balancer:
auth_token: oneandone_private_api_key
load_balancer: ansible load balancer updated
description: Adding rules to a load balancer with ansible
remove_rules:
- rule_id #1
- rule_id #2
- ...
wait: true
wait_timeout: 500
state: update
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
load_balancer
dictionary
|
always |
Information about the load balancer that was processed
Sample:
{"id": "92B74394A397ECC3359825C1656D67A6", "name": "Default Balancer"}
|
Authors¶
Amel Ajdinovic (@aajdinov)
Ethan Devenport (@edevenport)