It appears as though others have recognized this limitation and have
submitted pull requests for a module that would do what you are looking for:
- library/cloud/digital_ocean_domain_record (2)
- #8509 Add digital_ocean_domain_record to manage specific DNS
records in digital_ocean.
<https://github.com/ansible/ansible/pull/8509> (dopry
<https://github.com/ansible/ansible/pulls/dopry>)
- #7271 Module for creating/updating/deleting a domain record in
Digital Ocean <https://github.com/ansible/ansible/pull/7271> (
tombamford <https://github.com/ansible/ansible/pulls/tombamford>)
On Thu, Sep 11, 2014 at 7:14 AM, Jeff Johnson <[email protected]>
wrote:
> 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
> name=example-1.com
> 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
> name={{ hs2.droplet.name }}.example-1.com
> ip={{ hs2.droplet.ip_address }}
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/e2cccea4-b0f4-459f-9769-ed848eca9c80%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/e2cccea4-b0f4-459f-9769-ed848eca9c80%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
Matt Martz
[email protected]
http://sivel.net/
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAD8N0v_GA0XExhUqZdoHRonjeaaoWs0K34zRGT64ATpufKjftA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.