ngine_io / ngine_io.cloudstack / 2.3.0 / module / cs_loadbalancer_rule_member Manages load balancer rule members on Apache CloudStack based clouds. | "added in version" 0.1.0 of ngine_io.cloudstack" Authors: Darren Worrall (@dazworrall), René Moser (@resmo)ngine_io.cloudstack.cs_loadbalancer_rule_member (2.3.0) — module
Install with ansible-galaxy collection install ngine_io.cloudstack:==2.3.0
collections: - name: ngine_io.cloudstack version: 2.3.0
Add and remove load balancer rule members.
- name: Add VMs to an existing load balancer ngine_io.cloudstack.cs_loadbalancer_rule_member: name: balance_http vms: - web01 - web02
- name: Remove a VM from an existing load balancer ngine_io.cloudstack.cs_loadbalancer_rule_member: name: balance_http vms: - web01 - web02 state: absent
# Rolling upgrade of hosts - hosts: webservers serial: 1 pre_tasks: - name: Remove from load balancer ngine_io.cloudstack.cs_loadbalancer_rule_member: name: balance_http vm: "{{ ansible_hostname }}" state: absent tasks: # Perform update post_tasks: - name: Add to load balancer ngine_io.cloudstack.cs_loadbalancer_rule_member: name: balance_http vm: "{{ ansible_hostname }}" state: present
vms: aliases: - vm description: - List of VMs to assign to or remove from the rule. elements: str required: true type: list name: description: - The name of the load balancer rule. required: true type: str zone: description: - Name of the zone in which the rule should be located. - Required when the LB provider is ElasticLoadBalancerVm type: str state: choices: - present - absent default: present description: - Should the VMs be present or absent from the rule. type: str domain: description: - Domain the rule is related to. type: str account: description: - Account the rule is related to. type: str api_key: description: - API key of the CloudStack API. - If not given, the C(CLOUDSTACK_KEY) env variable is considered. required: true type: str api_url: description: - URL of the CloudStack API e.g. https://cloud.example.com/client/api. - If not given, the C(CLOUDSTACK_ENDPOINT) env variable is considered. required: true type: str project: description: - Name of the project the firewall rule is related to. type: str api_secret: description: - Secret key of the CloudStack API. - If not set, the C(CLOUDSTACK_SECRET) env variable is considered. required: true type: str ip_address: aliases: - public_ip description: - Public IP address from where the network traffic will be load balanced from. - Only needed to find the rule if I(name) is not unique. type: str poll_async: default: true description: - Poll async jobs until job has finished. type: bool api_timeout: default: 10 description: - HTTP timeout in seconds. - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered. type: int api_http_method: choices: - get - post default: get description: - HTTP method used to query the API endpoint. - If not given, the C(CLOUDSTACK_METHOD) env variable is considered. type: str api_verify_ssl_cert: description: - Verify CA authority cert file. - If not given, the C(CLOUDSTACK_VERIFY) env variable is considered. type: str
account: description: Account the rule is related to. returned: success sample: example account type: str algorithm: description: Load balancer algorithm used. returned: success sample: source type: str cidr: description: CIDR to forward traffic from. returned: success sample: 0.0.0.0/0 type: str description: description: Description of the rule. returned: success sample: http load balancer rule type: str domain: description: Domain the rule is related to. returned: success sample: example domain type: str id: description: UUID of the rule. returned: success sample: a6f7a5fc-43f8-11e5-a151-feff819cdc9f type: str name: description: Name of the rule. returned: success sample: http-lb type: str private_port: description: Private IP address. returned: success sample: 80 type: int project: description: Name of project the rule is related to. returned: success sample: Production type: str protocol: description: Protocol of the rule. returned: success sample: tcp type: str public_ip: description: Public IP address. returned: success sample: 1.2.3.4 type: str public_port: description: Public port. returned: success sample: 80 type: int state: description: State of the rule. returned: success sample: Add type: str tags: description: List of resource tags associated with the rule. returned: success sample: '[ { "key": "foo", "value": "bar" } ]' type: list vms: description: Rule members. returned: success sample: '[ "web01", "web02" ]' type: list zone: description: Name of zone the rule is related to. returned: success sample: ch-gva-2 type: str