community.digitalocean.digital_ocean_domain – Create/delete a DNS domain in DigitalOcean¶
Note
This plugin is part of the community.digitalocean collection (version 1.1.1).
To install it use: ansible-galaxy collection install community.digitalocean
.
To use it in a playbook, specify: community.digitalocean.digital_ocean_domain
.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.6
Parameters¶
Notes¶
Note
Environment variables DO_OAUTH_TOKEN can be used for the oauth_token.
As of Ansible 1.9.5 and 2.0, Version 2 of the DigitalOcean API is used, this removes
client_id
andapi_key
options in favor ofoauth_token
.If you are running Ansible 1.9.4 or earlier you might not be able to use the included version of this module as the API version used has been retired.
Examples¶
- name: Create a domain
community.digitalocean.digital_ocean_domain:
state: present
name: my.digitalocean.domain
ip: 127.0.0.1
# Create a droplet and corresponding domain
- name: Create a droplet
community.digitalocean.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
community.digitalocean.digital_ocean_domain:
state: present
name: "{{ test_droplet.droplet.name }}.my.domain"
ip: "{{ test_droplet.droplet.ip_address }}"
Authors¶
Michael Gregson (@mgregson)