ansible.builtin.digital_ocean_domain (v2.5.12) — module

Create/delete a DNS record in DigitalOcean

| "added in version" 1.6 of ansible.builtin"

Authors: Michael Gregson (@mgregson)

stableinterface | supported by community

Install Ansible via pip

Install with pip install ansible==2.5.12

Description

Create/delete a DNS record in DigitalOcean.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a domain record

- digital_ocean_domain:
    state: present
    name: my.digitalocean.domain
    ip: 127.0.0.1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a droplet and a corresponding domain record

- digital_ocean:
    state: present
    name: test_droplet
    size_id: 1gb
    region_id: sgp1
    image_id: ubuntu-14-04-x64


  register: test_droplet
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- digital_ocean_domain:
    state: present
    name: "{{ test_droplet.droplet.name }}.my.domain"
    ip: "{{ test_droplet.droplet.ip_address }}"

Inputs

    
id:
    aliases:
    - droplet_id
    description:
    - Numeric, the droplet id you want to operate on.

ip:
    description:
    - The IP address to point a domain at.

name:
    description:
    - String, this is the name of the droplet - must be formatted by hostname rules, or
      the name of a SSH key, or the name of a domain.

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

oauth_token:
    aliases:
    - API_TOKEN
    description:
    - DigitalOcean api token.
    version_added: 1.9.5
    version_added_collection: ansible.builtin