cloudscale_ch.cloud.floating_ip – Manages floating IPs on the cloudscale.ch IaaS service¶
Note
This plugin is part of the cloudscale_ch.cloud collection (version 1.3.1).
To install it use: ansible-galaxy collection install cloudscale_ch.cloud
.
To use it in a playbook, specify: cloudscale_ch.cloud.floating_ip
.
New in version 1.0.0: of cloudscale_ch.cloud
Parameters¶
Notes¶
Note
Once a floating_ip is created, all parameters except
server
,reverse_ptr
andtags
are read-only.All operations are performed using the cloudscale.ch public API v1.
For details consult the full API documentation: https://www.cloudscale.ch/en/api/v1.
A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at https://control.cloudscale.ch.
Examples¶
# Request a new floating IP without assignment to a server
- name: Request a floating IP
cloudscale_ch.cloud.floating_ip:
name: IP to my server
ip_version: 4
reverse_ptr: my-server.example.com
api_token: xxxxxx
# Request a new floating IP with assignment
- name: Request a floating IP
cloudscale_ch.cloud.floating_ip:
name: web
ip_version: 4
server: 47cec963-fcd2-482f-bdb6-24461b2d47b1
reverse_ptr: my-server.example.com
api_token: xxxxxx
# Assign an existing floating IP to a different server by its IP address
- name: Move floating IP to backup server
cloudscale_ch.cloud.floating_ip:
ip: 192.0.2.123
server: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
api_token: xxxxxx
# Assign an existing floating IP to a different server by name
- name: Move floating IP to backup server
cloudscale_ch.cloud.floating_ip:
name: IP to my server
server: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
api_token: xxxxxx
# Request a new floating IPv6 network
- name: Request a floating IP
cloudscale_ch.cloud.floating_ip:
name: IPv6 to my server
ip_version: 6
prefix_length: 56
server: 47cec963-fcd2-482f-bdb6-24461b2d47b1
api_token: xxxxxx
region: lpg1
# Assign an existing floating network to a different server
- name: Move floating IP to backup server
cloudscale_ch.cloud.floating_ip:
ip: '{{ floating_ip.ip }}'
server: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
api_token: xxxxxx
# Remove a floating IP
- name: Release floating IP
cloudscale_ch.cloud.floating_ip:
ip: 192.0.2.123
state: absent
api_token: xxxxxx
# Remove a floating IP by name
- name: Release floating IP
cloudscale_ch.cloud.floating_ip:
name: IP to my server
state: absent
api_token: xxxxxx
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Gaudenz Steinlin (@gaudenz)
Denis Krienbühl (@href)
René Moser (@resmo)