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

Create or Delete Anti Affinity Policies at 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 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
      clc_aa_policy:
        name: Hammer Time
        location: UK3
        state: present
      register: policy

    - name: debug
      debug:
        var: policy
  • 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
      clc_aa_policy:
        name: Hammer Time
        location: UK3
        state: present
      register: policy

    - name: debug
      debug:
        var: policy

---
- name: Delete AA Policy
  hosts: localhost
  gather_facts: False
  connection: local
  tasks:
    - name: Delete an Anti Affinity Policy
      clc_aa_policy:
        name: Hammer Time
        location: UK3
        state: absent
      register: policy

    - name: debug
      debug:
        var: policy

Inputs

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

wait:
    default: true
    description:
    - Whether to wait for the tasks to finish before returning.
    required: false
    type: bool

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

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

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