ansible / ansible.builtin / v2.9.27 / module / oneandone_load_balancer Configure 1&1 load balancer. | "added in version" 2.5 of ansible.builtin" Authors: Amel Ajdinovic (@aajdinov), Ethan Devenport (@edevenport) preview | supported by communityansible.builtin.oneandone_load_balancer (v2.9.27) — module
pip
Install with pip install ansible==2.9.27
Create, remove, update load balancers. This module has a dependency on 1and1 >= 1.0
# Provisioning example. Create and destroy a load balancer. - 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
- oneandone_load_balancer: auth_token: oneandone_private_api_key name: ansible load balancer wait: true wait_timeout: 500 state: absent
# Update a load balancer. - 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
# Add server to a load balancer. - 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
# Remove server from a load balancer. - 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
# Add rules to a load balancer. - 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
# Remove rules from a load balancer. - 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
name: description: - Load balancer name used with present state. Used as identifier (id or name) when used with absent state. maxLength=128 required: true wait: default: 'yes' description: - wait for the instance to be in state 'running' before returning required: false type: bool rules: description: - A list of rule objects that will be set for the load balancer. Each rule must contain protocol, port_balancer, and port_server parameters, in addition to source parameter, which is optional. required: true state: choices: - present - absent - update default: present description: - Define a load balancer state to create, remove, or update. required: false method: choices: - ROUND_ROBIN - LEAST_CONNECTIONS description: - Balancing procedure. required: true api_url: description: - Custom API URL. Overrides the ONEANDONE_API_URL environement variable. required: false add_rules: description: - A list of rules that will be added to an existing load balancer. It is syntax is the same as the one used for rules parameter. Used in combination with update state. required: false auth_token: description: - Authenticating API token provided by 1&1. required: true datacenter: choices: - US - ES - DE - GB default: US description: - ID or country code of the datacenter where the load balancer will be created. required: false description: description: - Description of the load balancer. maxLength=256 required: false persistence: description: - Persistence. required: true type: bool remove_rules: description: - A list of rule ids that will be removed from an existing load balancer. Used in combination with update state. required: false wait_timeout: default: 600 description: - how long before wait gives up, in seconds load_balancer: description: - The identifier (id or name) of the load balancer used with update state. required: true wait_interval: default: 5 description: - Defines the number of seconds to wait when using the _wait_for methods add_server_ips: description: - A list of server identifiers (id or name) to be assigned to a load balancer. Used in combination with update state. required: false persistence_time: description: - Persistence time in seconds. Required if persistence is enabled. minimum=30, maximum=1200, multipleOf=1 required: true health_check_path: description: - Url to call for checking. Required for HTTP health check. maxLength=1000 required: false health_check_test: choices: - NONE - TCP - HTTP - ICMP description: - Type of the health check. At the moment, HTTP is not allowed. required: true remove_server_ips: description: - A list of server IP ids to be unassigned from a load balancer. Used in combination with update state. required: false health_check_parse: description: - Regular expression to check. Required for HTTP health check. maxLength=64 required: false health_check_interval: description: - Health check period in seconds. minimum=5, maximum=300, multipleOf=1 required: true
load_balancer: description: Information about the load balancer that was processed returned: always sample: '{"id": "92B74394A397ECC3359825C1656D67A6", "name": "Default Balancer"}' type: dict