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

Add and Delete public ips on servers 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 add or delete public ip addresses on an existing server or servers 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: Add Public IP to Server
  hosts: localhost
  gather_facts: False
  connection: local
  tasks:
    - name: Create Public IP For Servers
      clc_publicip:
        protocol: TCP
        ports:
          - 80
        server_ids:
          - UC1TEST-SVR01
          - UC1TEST-SVR02
        state: present
      register: clc

    - name: debug
      debug:
        var: clc
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete Public IP from Server
  hosts: localhost
  gather_facts: False
  connection: local
  tasks:
    - name: Create Public IP For Servers
      clc_publicip:
        server_ids:
          - UC1TEST-SVR01
          - UC1TEST-SVR02
        state: absent
      register: clc

    - name: debug
      debug:
        var: clc

Inputs

    
wait:
    default: 'yes'
    description:
    - Whether to wait for the tasks to finish before returning.
    type: bool

ports:
    description:
    - A list of ports to expose. This is required when state is 'present'

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Determine whether to create or delete public IPs. If present module will not create
      a second public ip if one already exists.

protocol:
    choices:
    - TCP
    - UDP
    - ICMP
    default: TCP
    description:
    - The protocol that the public IP will listen for.

server_ids:
    description:
    - A list of servers to create public ips on.
    required: true

Outputs

server_ids:
  description: The list of server ids that are changed
  returned: success
  sample:
  - UC1TEST-SVR01
  - UC1TEST-SVR02
  type: list