Note
This module is part of the community.digitalocean collection (version 1.27.0).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.digitalocean. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: community.digitalocean.digital_ocean_floating_ip.
The below requirements are needed on the host that executes this module.
Parameter | Comments |
|---|---|
droplet_id string | The Droplet that the Floating IP has been assigned to. |
ip aliases: id string | Public IP address of the Floating IP. Used to remove an IP |
oauth_token string / required | DigitalOcean OAuth token. |
project_name aliases: project string | Project to assign the resource to (project name, not UUID). Defaults to the default project of the account (empty string). Currently only supported when creating. Default: |
region string | The region that the Floating IP is reserved to. |
state string | Indicate desired state of the target. If If If If Choices:
|
timeout integer | Floating IP creation timeout. Default: |
validate_certs boolean | If set to This should only set to Choices:
|
Note
- name: "Create a Floating IP in region lon1"
community.digitalocean.digital_ocean_floating_ip:
state: present
region: lon1
- name: Create a Floating IP in region lon1 (and assign to Project "test")
community.digitalocean.digital_ocean_floating_ip:
state: present
region: lon1
project: test
- name: "Create a Floating IP assigned to Droplet ID 123456"
community.digitalocean.digital_ocean_floating_ip:
state: present
droplet_id: 123456
- name: "Attach an existing Floating IP of 1.2.3.4 to Droplet ID 123456"
community.digitalocean.digital_ocean_floating_ip:
state: attached
ip: "1.2.3.4"
droplet_id: 123456
- name: "Detach an existing Floating IP of 1.2.3.4 from its Droplet"
community.digitalocean.digital_ocean_floating_ip:
state: detached
ip: "1.2.3.4"
- name: "Delete a Floating IP with ip 1.2.3.4"
community.digitalocean.digital_ocean_floating_ip:
state: absent
ip: "1.2.3.4"
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
assign_status string | Assignment status (ok, not_found, assigned, already_assigned, service_down) Returned: changed Sample: |
data dictionary | a DigitalOcean Floating IP resource Returned: success and no resource constraint Sample: |
msg string | Informational or error message encountered during execution Returned: changed Sample: |
resources dictionary | Resource assignment involved in project assignment Returned: changed Sample: |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/digitalocean/digital_ocean_floating_ip_module.html