ansible-collections / community.digitalocean

This Ansible collection contains modules for assisting in the automation of the DigitalOcean cloud.
https://galaxy.ansible.com/community/digitalocean/
GNU General Public License v3.0
141 stars 57 forks source link

Digital Ocean Domain Records #6

Closed Akasurde closed 3 years ago

Akasurde commented 4 years ago

From @chrispolley on Feb 02, 2018 19:29

ISSUE TYPE
COMPONENT NAME

digital_ocean_domain

ANSIBLE VERSION

I'm running

ansible 2.4.3.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/admin/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.13 (default, Nov 24 2017, 17:33:09) [GCC 6.3.0 20170516]

but plan to develop against a branch of a fork of ansible/devel

CONFIGURATION

No changes from apt-get install

OS / ENVIRONMENT

N/A

SUMMARY

I'm wondering if anyone is working on support for Digital Ocean Domain Records -- see the v2 API for the spec. The digital_ocean_domain module seems only to be able to add/remove domains, while implementing a workflow that installs and configures droplets to have specific roles in an infrastructure would require also DNS changes (e.g. adding/removing A, AAAA, CNAME, MX, etc records)

The description for digital_ocean_domain states that it will "Create/delete a DNS record in DigitalOcean" however perhaps a more accurate description is that it will "Create/delete a DNS domain in DigitalOcean". It has the edit_domain_record method but it appears that this is used only to insert an initial "A" record into the domain. It is not tooled to add/remove/edit other types of records.

Question: Should this functionality be written in a new module digital_ocean_domain_record or should the digital_ocean_domain module be extended to add this functionality? In my opinion it seems that isolating functionality along the same way the DO API organizes it would be best, if for no other reason than to maintain parallelism with the API and reduce the learning curve for people familiar with it (as well as to leverage the documentation).

My ultimate goal is to write a playbook that will install, configure and activate services (possibly provisioning a droplet) based on tags specified, and to re/deconfigure a droplet based on tags assigned (or removed) using DO API/control panel/etc. This would include inserting DNS records (such as adding a MX record for a droplet tagged with the mail-server tag).

Thanks!

Copied from original issue: ansible/ansible#35669

Akasurde commented 4 years ago

From @BondAnthony on Feb 03, 2018 19:54

Hey @chrispolley thank you for showing interest in the Digital Ocean modules. Please take a look at PR #31765 and see if meets your requirements.

Akasurde commented 4 years ago

From @chrispolley on Feb 05, 2018 17:47

Hi Anthony, Thanks very much for the reference -- this looks like it will do it for me. I'll pull this branch and try it out.

Regards, Chris

On Sat, Feb 3, 2018 at 1:55 PM, ABond notifications@github.com wrote:

Hey @chrispolley https://github.com/chrispolley thank you for showing interest in the Digital Ocean modules. Please take a look at PR #31765 https://github.com/ansible/ansible/pull/31765 and see if meets your requirements.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ansible/ansible/issues/35669#issuecomment-362849256, or mute the thread https://github.com/notifications/unsubscribe-auth/AHM_jA0Cn16iaMAOFQNxXFn7blKWzIq4ks5tRLmogaJpZM4R3qfl .

Akasurde commented 4 years ago

From @avollmerhaus on Nov 27, 2019 13:58

Are there any plans to fix this? It would be very nice to at least be able to create AAAA records for my droplets!

rezen commented 4 years ago

Here is the PR from the previous repo https://github.com/ansible/ansible/pull/31765/files

jamesharr commented 3 years ago

FYI, the feature

From @BondAnthony on Feb 03, 2018 19:54

Hey @chrispolley thank you for showing interest in the Digital Ocean modules. Please take a look at PR #31765 and see if meets your requirements.

FYI - this PR was abandoned. I would benefit from this feature.

rezen commented 3 years ago

@jamesharr you should add a comment to the PR I have in this repo

KornKalle commented 3 years ago

For everyone else, ending here after looking for a solution: I created an Ansible Role for managing domains and it's records. It uses the official ansible module and the Digitalocean REST API:

https://galaxy.ansible.com/kornkalle/ansible_digitalocean_dns

mamercad commented 3 years ago

Fixed in https://github.com/ansible-collections/community.digitalocean/pull/33, I'm working on a release branch.