Note
This plugin is part of the cloudscale_ch.cloud collection.
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
Parameter | Choices/Defaults | Comments |
---|---|---|
api_timeout integer | Default: 30 | Timeout in seconds for calls to the cloudscale.ch API. |
api_token string / required | 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. |
region string | Region in which the floating IP resides (e.g. lgp or rma ). If omitted, the region of the project default zone is used. This parameter must be omitted if type is set to global . | |
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. | |
state string |
| State of the floating IP. |
tags dictionary added in 1.1.0 of cloudscale_ch.cloud | Tags associated with the floating IP. Set this to {} to clear any tags. | |
type string |
| The type of the floating IP. |
Note
ip
parameter.server
, reverse_ptr
and tags
are read-only.CLOUDSCALE_API_TOKEN
environment variable can be used.# Request a new floating IP without server assignment - name: Request a floating IP cloudscale_ch.cloud.floating_ip: ip_version: 4 api_token: xxxxxx # Request a new floating IP - name: Request a floating IP cloudscale_ch.cloud.floating_ip: 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 - 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 # Request a new floating IPv6 network - name: Request a floating IP cloudscale_ch.cloud.floating_ip: 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.network | ip }}' server: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48 api_token: xxxxxx # Release a floating IP - name: Release floating IP cloudscale_ch.cloud.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 |
region dictionary | success when state == present | The region of the floating IP. Sample: {'slug': 'lpg'} |
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 |
tags dictionary added in 1.1.0 of cloudscale_ch.cloud | success | Tags assosiated with the floating IP. Sample: {'project': 'my project'} |
© 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/cloudscale_ch/cloud/floating_ip_module.html