community / community.general / 0.2.1 / module / digital_ocean_domain Create/delete a DNS domain in DigitalOcean Authors: Michael Gregson (@mgregson)community.general.digital_ocean_domain (0.2.1) — module
Install with ansible-galaxy collection install community.general:==0.2.1
collections: - name: community.general version: 0.2.1
Create/delete a DNS domain in DigitalOcean.
- name: Create a domain digital_ocean_domain: state: present name: my.digitalocean.domain ip: 127.0.0.1
# Create a droplet and corresponding domain - name: Create a droplet digital_ocean: state: present name: test_droplet size_id: 1gb region_id: sgp1 image_id: ubuntu-14-04-x64 register: test_droplet
- name: Create a corresponding domain digital_ocean_domain: state: present name: "{{ test_droplet.droplet.name }}.my.domain" ip: "{{ test_droplet.droplet.ip_address }}"
id: aliases: - droplet_id description: - Numeric, the droplet id you want to operate on. ip: description: - An 'A' record for '@' ($ORIGIN) will be created with the value 'ip'. 'ip' is an IP version 4 address. 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. timeout: default: 30 description: - The timeout in seconds used for polling DigitalOcean's API. type: int oauth_token: aliases: - api_token description: - DigitalOcean OAuth token. - There are several other environment variables which can be used to provide this value. - i.e., - 'DO_API_TOKEN', 'DO_API_KEY', 'DO_OAUTH_TOKEN' and 'OAUTH_TOKEN' type: str validate_certs: default: true description: - If set to C(no), the SSL certificates will not be validated. - This should only set to C(no) used on personally controlled sites using self-signed certificates. type: bool