cloudscale_ch.cloud.load_balancer_pool_member (2.3.1) — module

Manages load balancer pool members 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 pool members on the cloudscale.ch IaaS service.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a pool member for a load balancer pool using registered variables
- name: Create a load balancer pool
  cloudscale_ch.cloud.load_balancer_pool:
    name: 'swimming-pool'
    load_balancer: '514064c2-cfd4-4b0c-8a4b-c68c552ff84f'
    algorithm: 'round_robin'
    protocol: 'tcp'
    tags:
      project: ansible-test
      stage: production
      sla: 24-7
    api_token: xxxxxx
  register: load_balancer_pool
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a load balancer pool member
  cloudscale_ch.cloud.load_balancer_pool_member:
    name: 'my-shiny-swimming-pool-member'
    load_balancer_pool: '{{ load_balancer_pool.uuid }}'
    enabled: true
    protocol_port: 8080
    monitor_port: 8081
    subnet: '70d282ab-2a01-4abb-ada5-34e56a5a7eee'
    address: '172.16.0.100'
    tags:
      project: ansible-test
      stage: production
      sla: 24-7
    api_token: xxxxxx
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get load balancer pool member facts by name
- name: Get facts of a load balancer pool member by name
  cloudscale_ch.cloud.load_balancer_pool_member:
    name: 'my-shiny-swimming-pool-member'
    api_token: xxxxxx

Inputs

    
name:
    description:
    - Name of the load balancer pool member.
    - 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

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

subnet:
    description:
    - The subnet of the address must be specified here.
    type: str

address:
    description:
    - The IP address to which traffic is sent.
    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

enabled:
    default: true
    description:
    - Pool member will not receive traffic if false. Default is true.
    type: bool

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

monitor_port:
    default: null
    description:
    - The port to which health monitor checks are sent.
    - If not specified, protocol_port will be used. Default is null.
    type: int

protocol_port:
    description:
    - The port to which actual traffic is sent.
    type: int

load_balancer_pool:
    description:
    - UUID of the load balancer pool.
    type: str

Outputs

address:
  description: The IP address to which traffic is sent
  returned: success
  sample: 10.11.12.3
  type: str
created_at:
  description: The creation date and time of the load balancer pool member
  returned: success when not state == absent
  sample: '2023-02-07T15:32:02.308041Z'
  type: str
enabled:
  description: THe status of the load balancer pool member
  returned: success
  sample: true
  type: bool
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/pools/20a7eb11-3e17-4177-b46d-36e13b101d1c/members/b9991773-857d-47f6-b20b-0a03709529a9
  type: str
monitor_port:
  description: The port to which health monitor checks are sent
  returned: success
  sample: 8081
  type: int
monitor_status:
  description: The status of the pool's health monitor check for this member
  returned: success
  sample: up
  type: str
name:
  description: The display name of the load balancer pool member
  returned: success
  sample: web-lb-pool
  type: str
pool:
  description: The pool of the pool member
  returned: success
  sample:
    href: https://api.cloudscale.ch/v1/load-balancers/pools/20a7eb11-3e17-4177-b46d-36e13b101d1c
    name: web-lb-pool
    uuid: 20a7eb11-3e17-4177-b46d-36e13b101d1c
  type: dict
protocol_port:
  description: The port to which actual traffic is sent
  returned: success
  sample: 8080
  type: int
subnet:
  description: The subnet in a private network in which address is located
  returned: success
  sample:
    cidr: 10.11.12.0/24
    href: https://api.cloudscale.ch/v1/subnets/70d282ab-2a01-4abb-ada5-34e56a5a7eee
    uuid: 70d282ab-2a01-4abb-ada5-34e56a5a7eee
  type: dict
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 pool member
  returned: success
  sample: cfde831a-4e87-4a75-960f-89b0148aa2cc
  type: str