cloudscale_ch.cloud.load_balancer (2.3.1) — module

Manages load balancers on the cloudscale.ch IaaS service

| "added in version" 2.3.0 of cloudscale_ch.cloud"

Authors: Gaudenz Steinlin (@gaudenz), Kenneth Joss (@k-304)

Install collection

Install with ansible-galaxy collection install cloudscale_ch.cloud:==2.3.1


Add to requirements.yml

  collections:
    - name: cloudscale_ch.cloud
      version: 2.3.1

Description

Get, create, update, delete load balancers on the cloudscale.ch IaaS service.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create and start a load balancer
- name: Start cloudscale.ch load balancer
  cloudscale_ch.cloud.load_balancer:
    name: my-shiny-cloudscale-load-balancer
    flavor: lb-standard
    zone: rma1
    tags:
      project: my project
    api_token: xxxxxx
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create and start a load balancer with specific subnet
- name: Start cloudscale.ch load balancer
  cloudscale_ch.cloud.load_balancer:
    name: my-shiny-cloudscale-load-balancer
    flavor: lb-standard
    vip_addresses:
      - subnet: d7b82c9b-5900-436c-9296-e94dca01c7a0
        address: 172.25.12.1
    zone: lpg1
    tags:
      project: my project
    api_token: xxxxxx
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get load balancer facts by name
- name: Get facts of a load balancer
  cloudscale_ch.cloud.load_balancer:
    name: my-shiny-cloudscale-load-balancer
    api_token: xxxxxx

Inputs

    
name:
    description:
    - Name of the load balancer.
    - Either I(name) or I(uuid) are required.
    type: str

tags:
    description:
    - Tags assosiated with the load balancer. Set this to C({}) to clear any tags.
    type: dict

uuid:
    description:
    - UUID of the load balancer.
    - Either I(name) or I(uuid) are required.
    type: str

zone:
    description:
    - Zone in which the load balancer resides (e.g. C(lpg1) or C(rma1)).
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the load balancer.
    type: str

flavor:
    default: lb-standard
    description:
    - Flavor of the load balancer.
    type: str

api_url:
    default: https://api.cloudscale.ch/v1
    description:
    - cloudscale.ch API URL.
    - This can also be passed in the C(CLOUDSCALE_API_URL) environment variable.
    type: str
    version_added: 1.3.0
    version_added_collection: cloudscale_ch.cloud

api_token:
    description:
    - cloudscale.ch API token.
    - This can also be passed in the C(CLOUDSCALE_API_TOKEN) environment variable.
    required: true
    type: str

api_timeout:
    default: 45
    description:
    - Timeout in seconds for calls to the cloudscale.ch API.
    - This can also be passed in the C(CLOUDSCALE_API_TIMEOUT) environment variable.
    type: int

vip_addresses:
    description:
    - See the [API documentation](https://www.cloudscale.ch/en/api/v1#vip_addresses-attribute-specification)
      for details about this parameter.
    elements: dict
    suboptions:
      address:
        description:
        - Use this address.
        - Must be in the same range as subnet.
        - If empty, a radom address will be used.
        type: str
      subnet:
        description:
        - Create a VIP address on the subnet identified by this UUID.
        type: str
    type: list

Outputs

created_at:
  description: The creation date and time of the load balancer
  returned: success when not state == absent
  sample: '2023-02-07T15:32:02.308041Z'
  type: str
flavor:
  description: The flavor that has been used for this load balancer
  returned: success when not state == absent
  sample:
    name: LB-Standard
    slug: lb-standard
  type: list
href:
  description: API URL to get details about this load balancer
  returned: success when not state == absent
  sample: https://api.cloudscale.ch/v1/load-balancers/0f62e0a7-f459-4fc4-9c25-9e57b6cb4b2f
  type: str
name:
  description: The display name of the load balancer
  returned: success
  sample: web-lb
  type: str
state:
  description: The current state of the load balancer
  returned: success
  sample: present
  type: str
status:
  description: The current operational status of the load balancer
  returned: success
  sample: running
  type: str
tags:
  description: Tags assosiated with the load balancer
  returned: success
  sample:
    project: my project
  type: dict
uuid:
  description: The unique identifier for this load balancer
  returned: success
  sample: cfde831a-4e87-4a75-960f-89b0148aa2cc
  type: str
vip_addresses:
  description: List of vip_addresses for this load balancer
  returned: success when not state == absent
  sample:
  - address: 192.0.2.110
    subnet:
    - href: https://api.cloudscale.ch/v1/subnets/92c70b2f-99cb-4811-8823-3d46572006e4
    - uuid: 92c70b2f-99cb-4811-8823-3d46572006e4
    - cidr: 192.0.2.0/24
    version: '4'
  type: dict
zone:
  description: The zone used for this load balancer
  returned: success when not state == absent
  sample:
    slug: lpg1
  type: dict