Sorry for the delay, I didn't see your response until this morning.
I have my script below which is taken almost verbatim from
http://docs.ansible.com/digital_ocean_domain_module.html. The first call to digital_ocean_domain creates a zone file for "
example-1.com" with NS records and a default A record "@". Then it creates a droplet, then it calls digital_ocean_domain again to, hopefully, create a A record for the droplet that was just created and in the existing zone file. What it actually does is create another zone file for "
hs2.example-1.com" with NS records and a default A record "@". So if I create 10 droplets under a domain I would end up with 10 zone files instead of one zone file containing 10 A records as I would expect.
Maybe this was intentional, and I suspect it would work, but it's not the way I would ever setup DNS. So if it is intentional there should be a big warning in the docs to say so.
Thanks for reading :)
---
- hosts: 127.0.0.1
tasks:
- name: "Ensure that the SSH key exists for the account"
digital_ocean_sshkey:
state=present
name=jeff
ssh_pub_key='*************HIDDEN*************'
register: my_ssh_key
- digital_ocean_domain: >
state=present
ip=127.0.0.1
- digital_ocean: >
state=present
name=hs2
size_id=66
region_id=4
image_id=5141286
register: hs2
- digital_ocean_domain: >
state=present
ip={{ hs2.droplet.ip_address }}