Skip to content

Instantly share code, notes, and snippets.

@overdrive3000
Created September 30, 2015 13:08
Show Gist options
  • Save overdrive3000/dc9626dae9827ef28875 to your computer and use it in GitHub Desktop.
Save overdrive3000/dc9626dae9827ef28875 to your computer and use it in GitHub Desktop.
Modify Route53 record using Ansible in a private hosted zone
---
- name: Debug
hosts: localhost
tasks:
- debug: var=ansible_eth0["ipv4"]["address"]
- name: Get DNS record information
hosts: localhost
tasks:
- route53: command=get zone=foo.com record=subdomain.foo.com type=A private_zone=true
register: rec
- name: Print record
debug: var=rec
- name: Edit Route53 record
hosts: localhost
tasks:
- route53: command=create zone=foo.com record=subdomain.foo.com type=A ttl=300 value={{ ansible_eth0["ipv4"]["address"] }} overwrite=true private_zone=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment