Yeah, currently the route53 module does not create zones. They have to already be created. The boto module (which we're using to interact with route53 and most other amazon services) appears to support creating zones so so we'd probably take a pull request to implement that.
-Toshio On Tue, Dec 9, 2014 at 11:30 AM, Carlos V <[email protected]> wrote: > Is it possible to add a domain to route53 from Ansible? > > Looks like it's only possible to add/modify records once you have the zone > configured but maybe I'm doing it wrong. > > > Playbook: > > - name: Setup for DNS in AWS > hosts: 127.0.0.1 > gather_facts: false > connection: local > tasks: > - route53: > command: create > zone: "example.com" > record: "new.example.com" > type: A > value: "xxx.xxx.xxx.xxx" > overwrite: true > > > > Output: > > # ansible-playbook -i local 53.yml -vvvv > > PLAY [Setup for DNS in AWS] > *************************************************** > > TASK: [route53 ] > ************************************************************** > <127.0.0.1> REMOTE_MODULE route53 type=A command=create > record=new.example.com value=xxx.xxx.xxx.xxx zone=example.com > <127.0.0.1> EXEC ['/bin/sh', '-c', 'mkdir -p > $HOME/.ansible/tmp/ansible-tmp-1418152704.32-223011961135662 && echo > $HOME/.ansible/tmp/ansible-tmp-1418152704.32-223011961135662'] > <127.0.0.1> PUT /tmp/tmpCH8AVM TO > /root/.ansible/tmp/ansible-tmp-1418152704.32-223011961135662/route53 > <127.0.0.1> EXEC ['/bin/sh', '-c', u'LANG=C LC_CTYPE=C /usr/bin/python > /root/.ansible/tmp/ansible-tmp-1418152704.32-223011961135662/route53; rm -rf > /root/.ansible/tmp/ansible-tmp-1418152704.32-223011961135662/ >/dev/null > 2>&1'] > failed: [127.0.0.1] => {"failed": true} > > msg: Zone example.com. does not exist in Route53 > > FATAL: all hosts have already failed -- aborting > > PLAY RECAP > ******************************************************************** > to retry, use: --limit @/root/53.retry > > 127.0.0.1 : ok=0 changed=0 unreachable=0 failed=1 > > > > -- > 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/f836430f-7349-4255-95e8-c1144624d99a%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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/CAG9juEp5iqo-_nZ4MGD7ps8gZmoN%2BCw_580yzDwyuBaPTmZ3cg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
