community.general.clc_aa_policy (8.5.0) — module

Create or Delete Anti Affinity Policies at CenturyLink Cloud

Authors: CLC Runner (@clc-runner)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

An Ansible module to Create or Delete Anti Affinity Policies at 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 AA Policy
  hosts: localhost
  gather_facts: false
  connection: local
  tasks:
    - name: Create an Anti Affinity Policy
      community.general.clc_aa_policy:
        name: Hammer Time
        location: UK3
        state: present
      register: policy

    - name: Debug
      ansible.builtin.debug:
        var: policy
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete AA Policy
  hosts: localhost
  gather_facts: false
  connection: local
  tasks:
    - name: Delete an Anti Affinity Policy
      community.general.clc_aa_policy:
        name: Hammer Time
        location: UK3
        state: absent
      register: policy

    - name: Debug
      ansible.builtin.debug:
        var: policy

Inputs

    
name:
    description:
    - The name of the Anti Affinity Policy.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether to create or delete the policy.
    required: false
    type: str

location:
    description:
    - Datacenter in which the policy lives/should live.
    required: true
    type: str

Outputs

policy:
  description: The anti affinity policy information
  returned: success
  sample:
    id: 1a28dd0988984d87b9cd61fa8da15424
    links:
    - href: /v2/antiAffinityPolicies/wfad/1a28dd0988984d87b9cd61fa8da15424
      rel: self
      verbs:
      - GET
      - DELETE
      - PUT
    - href: /v2/datacenters/wfad/UC1
      id: uc1
      name: UC1 - US West (Santa Clara)
      rel: location
    location: UC1
    name: test_aa_policy
  type: dict