New in version 2.0.
The below requirements are needed on the host that executes this module.
Parameter |
Choices/Defaults |
Comments |
---|---|---|
ports
|
|
A list of ports to expose. This is required when state is 'present'
|
protocol
|
|
The protocol that the public IP will listen for.
|
server_ids
required |
|
A list of servers to create public ips on.
|
state
|
|
Determine whether to create or delete public IPs. If present module will not create a second public ip if one already exists.
|
wait
|
|
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
clc_publicip:
protocol: TCP
ports:
- 80
server_ids:
- UC1TEST-SVR01
- UC1TEST-SVR02
state: present
register: clc
- name: debug
debug:
var: clc
- 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
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
---|---|---|
server_ids
list
|
success |
The list of server ids that are changed
Sample:
['UC1TEST-SVR01', 'UC1TEST-SVR02']
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Hint
If you notice any issues in this documentation you can edit this document to improve it.