Created
May 4, 2017 08:19
-
-
Save famousgarkin/4da1a34c1f8402f5f0000586b2fc40a9 to your computer and use it in GitHub Desktop.
Ansible AWS Route 53 export playbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: localhost | |
gather_facts: no | |
tasks: | |
- name: get hosted zones | |
route53_facts: query=hosted_zone | |
register: hosted_zone | |
- name: get record sets | |
route53_facts: query=record_sets hosted_zone_id={{item.Id}} | |
with_items: '{{hosted_zone.HostedZones}}' | |
register: record_sets | |
- name: save record sets | |
copy: content={{item.1|to_nice_json}} dest=files/dns/aws-route53-{{item.0.Name}}json | |
with_together: | |
- '{{hosted_zone.HostedZones}}' | |
- '{{record_sets.results}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment