Adding an A DNS record
DigitalOcean provides a DNS service where we can add our domains and various related records. The Ansible module for the DNS is available; however, it supports only basic operations; that is, creating an A record.
How to do it…
We can use digital_ocean_domain
module to create an A record.
- name: associate domain and IP digital_ocean_domain: state: present name: ansiblecloudbook.com ip: "{{ app_droplet.droplet.ip_address }}" api_token: "{{ DO_OAUTH_TOKEN }}"
For this task, we have supplied a domain name and IP address for creating the record. This is as far as this module goes. For advanced operations, we can use the doctl
command-line tool or the web dashboard.