community.general.digital_ocean_floating_ip (0.2.1) — module

Manage DigitalOcean Floating IPs

Authors: Patrick Marques (@pmarques)

Install collection

Install with ansible-galaxy collection install community.general:==0.2.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.2.1

Description

Create/delete/assign a floating IP.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Create a Floating IP in region lon1"
  digital_ocean_floating_ip:
    state: present
    region: lon1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Create a Floating IP assigned to Droplet ID 123456"
  digital_ocean_floating_ip:
    state: present
    droplet_id: 123456
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Delete a Floating IP with ip 1.2.3.4"
  digital_ocean_floating_ip:
    state: absent
    ip: "1.2.3.4"

Inputs

    
ip:
    description:
    - Public IP address of the Floating IP. Used to remove an IP

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Indicate desired state of the target.

region:
    description:
    - The region that the Floating IP is reserved to.

droplet_id:
    description:
    - The Droplet that the Floating IP has been assigned to.

oauth_token:
    description:
    - DigitalOcean OAuth token.
    required: true

Outputs

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