Note
This plugin is part of the community.general collection.
To install it use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.clc_publicip.
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| ports string | A list of ports to expose. This is required when state is 'present' | |
| protocol string |
| The protocol that the public IP will listen for. |
| server_ids string / required | A list of servers to create public ips on. | |
| state string |
| Determine whether to create or delete public IPs. If present module will not create a second public ip if one already exists. |
| wait boolean |
| Whether to wait for the tasks to finish before returning. |
Note
# 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
community.general.clc_publicip:
protocol: TCP
ports:
- 80
server_ids:
- UC1TEST-SVR01
- UC1TEST-SVR02
state: present
register: clc
- name: Debug
ansible.builtin.debug:
var: clc
- name: Delete Public IP from Server
hosts: localhost
gather_facts: False
connection: local
tasks:
- name: Create Public IP For Servers
community.general.clc_publicip:
server_ids:
- UC1TEST-SVR01
- UC1TEST-SVR02
state: absent
register: clc
- name: Debug
ansible.builtin.debug:
var: clc
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
| server_ids list / elements=string | success | The list of server ids that are changed Sample: ['UC1TEST-SVR01', 'UC1TEST-SVR02'] |
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/general/clc_publicip_module.html