W3cubDocs

/Ansible

digital_ocean_floating_ip - Manage DigitalOcean Floating IPs

New in version 2.4.

Synopsis

  • Create/delete/assign a floating IP.

Requirements (on host that executes module)

  • python >= 2.6

Options

parameter required default choices comments
droplet_id
no None
The Droplet that the Floating IP has been assigned to.
ip
no None
Public IP address of the Floating IP. Used to remove an IP
oauth_token
yes
DigitalOcean OAuth token.
region
no None
The region that the Floating IP is reserved to.
state
no present
  • present
  • absent
Indicate desired state of the target.

Examples

- name: "Create a Floating IP in region lon1"
  digital_ocean_floating_ip:
    state: present
    region: lon1

- name: "Create a Floating IP assigned to Droplet ID 123456"
  digital_ocean_floating_ip:
    state: present
    droplet_id: 123456

- name: "Delete a Floating IP with ip 1.2.3.4"
  digital_ocean_floating_ip:
    state: absent
    ip: "1.2.3.4"

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
data
a DigitalOcean Floating IP resource
success and no resource constraint dict {'action': {'status': 'in-progress', 'resource_id': 758603823, 'region': {'available': True, 'slug': 'nyc3', 'features': ['private_networking', 'backups', 'ipv6', 'metadata'], 'name': 'New York 3', 'sizes': ['512mb', '1gb', '2gb', '4gb', '8gb', '16gb', '32gb', '48gb', '64gb']}, 'region_slug': 'nyc3', 'completed_at': None, 'started_at': '2015-10-15T17:45:44Z', 'type': 'assign_ip', 'id': 68212728, 'resource_type': 'floating_ip'}}

Notes

Note

  • Version 2 of DigitalOcean API is used.

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/digital_ocean_floating_ip_module.html