ansible.builtin.clc_loadbalancer (v2.9.27) — module

Create, Delete shared loadbalancers in CenturyLink Cloud.

| "added in version" 2.0 of ansible.builtin"

Authors: CLC Runner (@clc-runner)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

An Ansible module to Create, Delete shared loadbalancers in CenturyLink Cloud.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
name:
    description:
    - The name of the loadbalancer
    required: true

port:
    choices:
    - 80
    - 443
    description:
    - Port to configure on the public-facing side of the load balancer pool

alias:
    description:
    - The alias of your CLC Account
    required: true

nodes:
    default: []
    description:
    - A list of nodes that needs to be added to the load balancer pool

state:
    choices:
    - present
    - absent
    - port_absent
    - nodes_present
    - nodes_absent
    default: present
    description:
    - Whether to create or delete the load balancer pool

method:
    choices:
    - leastConnection
    - roundRobin
    description: -The balancing method for the load balancer pool

status:
    choices:
    - enabled
    - disabled
    default: enabled
    description:
    - The status of the loadbalancer

location:
    description:
    - The location of the datacenter where the load balancer resides in
    required: true

description:
    description:
    - A description for the loadbalancer

persistence:
    choices:
    - standard
    - sticky
    description:
    - The persistence method for the load balancer

Outputs

loadbalancer:
  description: The load balancer result object from CLC
  returned: success
  sample:
    description: test-lb
    id: ab5b18cb81e94ab9925b61d1ca043fb5
    ipAddress: 66.150.174.197
    links:
    - href: /v2/sharedLoadBalancers/wfad/wa1/ab5b18cb81e94ab9925b61d1ca043fb5
      rel: self
      verbs:
      - GET
      - PUT
      - DELETE
    - href: /v2/sharedLoadBalancers/wfad/wa1/ab5b18cb81e94ab9925b61d1ca043fb5/pools
      rel: pools
      verbs:
      - GET
      - POST
    name: test-lb
    pools: []
    status: enabled
  type: dict