Note
This plugin is part of the hetzner.hcloud collection.
To install it use: ansible-galaxy collection install hetzner.hcloud
.
To use it in a playbook, specify: hetzner.hcloud.hcloud_floating_ip
.
New in version 0.1.0: of hetzner.hcloud
The below requirements are needed on the host that executes this module.
Parameter | Choices/Defaults | Comments |
---|---|---|
api_token string / required | This is the API Token for the Hetzner Cloud. | |
delete_protection boolean |
| Protect the Floating IP for deletion. |
description string | The Description of the Hetzner Cloud Floating IPs. | |
endpoint string | Default: "https://api.hetzner.cloud/v1" | This is the API Endpoint for the Hetzner Cloud. |
force boolean |
| Force the assignment or deletion of the Floating IP. |
home_location string | Home Location of the Hetzner Cloud Floating IP. Required if no server is given and Floating IP does not exists. | |
id integer | The ID of the Hetzner Cloud Floating IPs to manage. Only required if no Floating IP name is given. | |
labels dictionary | User-defined labels (key-value pairs). | |
name string | The Name of the Hetzner Cloud Floating IPs to manage. Only required if no Floating IP id is given or a Floating IP does not exists. | |
server string | Server Name the Floating IP should be assigned to. Required if no home_location is given and Floating IP does not exists. | |
state string |
| State of the Floating IP. |
type string |
| Type of the Floating IP. Required if Floating IP does not exists |
See also
Complete reference for the Hetzner Cloud API.
- name: Create a basic IPv4 Floating IP hcloud_floating_ip: name: my-floating-ip home_location: fsn1 type: ipv4 state: present - name: Create a basic IPv6 Floating IP hcloud_floating_ip: name: my-floating-ip home_location: fsn1 type: ipv6 state: present - name: Assign a Floating IP to a server hcloud_floating_ip: name: my-floating-ip server: 1234 state: present - name: Assign a Floating IP to another server hcloud_floating_ip: name: my-floating-ip server: 1234 force: yes state: present - name: Floating IP should be absent hcloud_floating_ip: name: my-floating-ip state: absent
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description | |
---|---|---|---|
hcloud_floating_ip complex | Always | The Floating IP instance | |
delete_protection boolean added in 0.1.0 of hetzner.hcloud | always | True if Floating IP is protected for deletion | |
description string | Always | Description of the Floating IP Sample: my-floating-ip | |
home_location string | Always | Name of the home location of the Floating IP Sample: fsn1 | |
id integer | Always | ID of the Floating IP Sample: 12345 | |
ip string | Always | IP Address of the Floating IP Sample: 116.203.104.109 | |
labels dictionary | Always | User-defined labels (key-value pairs) Sample: {'key': 'value', 'mylabel': 123} | |
name string | Always | Name of the Floating IP Sample: my-floating-ip | |
server string | Always | Name of the server the Floating IP is assigned to. Sample: my-server | |
type string | Always | Type of the Floating IP Sample: ipv4 |
© 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/hetzner/hcloud/hcloud_floating_ip_module.html