cloudscale_floating_ip – Manages floating IPs on the cloudscale.ch IaaS service¶
New in version 2.5.
Parameters¶
Notes¶
Note
- To create a new floating IP at least the
ip_version
andserver
options are required. - Once a floating_ip is created all parameters except
server
are read-only. - It’s not possible to request a floating IP without associating it with a server at the same time.
- This module requires the ipaddress python library. This library is included in Python since version 3.3. It is available as a module on PyPI for earlier versions.
- Instead of the api_token parameter the
CLOUDSCALE_API_TOKEN
environment variable can be used. - 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
- name: Request a floating IP
cloudscale_floating_ip:
ip_version: 4
server: 47cec963-fcd2-482f-bdb6-24461b2d47b1
reverse_ptr: my-server.example.com
api_token: xxxxxx
register: floating_ip
# Assign an existing floating IP to a different server
- name: Move floating IP to backup server
cloudscale_floating_ip:
ip: 192.0.2.123
server: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
api_token: xxxxxx
# Request a new floating IPv6 network
- name: Request a floating IP
cloudscale_floating_ip:
ip_version: 6
prefix_length: 56
server: 47cec963-fcd2-482f-bdb6-24461b2d47b1
api_token: xxxxxx
register: floating_ip
# Assign an existing floating network to a different server
- name: Move floating IP to backup server
cloudscale_floating_ip:
ip: '{{ floating_ip.network | ip }}'
server: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
api_token: xxxxxx
# Release a floating IP
- name: Release floating IP
cloudscale_floating_ip:
ip: 192.0.2.123
state: absent
api_token: xxxxxx
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Gaudenz Steinlin (@gaudenz)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.