New in version 2.5.
Parameter | Choices/Defaults | Comments |
---|---|---|
api_timeout - | Default: 30 | Timeout in seconds for calls to the cloudscale.ch API. |
api_token - | cloudscale.ch API token. This can also be passed in the CLOUDSCALE_API_TOKEN environment variable. | |
ip string | Floating IP address to change. Required to assign the IP to a different server or if state is absent. aliases: network | |
ip_version integer |
| IP protocol version of the floating IP. |
prefix_length integer |
| Only valid if ip_version is 6. Prefix length for the IPv6 network. Currently only a prefix of /56 can be requested. If no prefix_length is present, a single address is created. |
reverse_ptr string | Reverse PTR entry for this address. You cannot set a reverse PTR entry for IPv6 floating networks. Reverse PTR entries are only allowed for single addresses. | |
server string | UUID of the server assigned to this floating IP. Required unless state is absent. | |
state string |
| State of the floating IP. |
Note
ip_version
and server
options are required.server
are read-only.CLOUDSCALE_API_TOKEN
environment variable can be used.# 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
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
href string | success when state == present | The API URL to get details about this floating IP. Sample: https://api.cloudscale.ch/v1/floating-ips/2001:db8::cafe |
ip string | success | The floating IP address or network. This is always present and used to identify floating IPs after creation. Sample: 185.98.122.176 |
network string | success when state == present | The CIDR notation of the network that is routed to your server. Sample: 2001:db8::cafe/128 |
next_hop string | success when state == present | Your floating IP is routed to this IP address. Sample: 2001:db8:dead:beef::42 |
reverse_ptr string | success when state == present | The reverse pointer for this floating IP address. Sample: 185-98-122-176.cust.cloudscale.ch |
server string | success when state == present | The floating IP is routed to this server. Sample: 47cec963-fcd2-482f-bdb6-24461b2d47b1 |
state string | success | The current status of the floating IP. Sample: present |
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/cloudscale_floating_ip_module.html