---
|
- environment:
|
AWS_PROFILE: "{{ account_profile }}"
|
block:
|
- name: Create the public zone
|
route53_zone:
|
zone: "{{ account_name }}{{subdomain_base}}."
|
register: _route53zone
|
retries: 5
|
delay: "{{ 60|random(start=3, step=1) }}"
|
until: _route53zone is succeeded
|
|
- set_fact:
|
account_hosted_zone_id: "{{ _route53zone.zone_id }}"
|
|
- name: Grab facts about the zone
|
route53_facts:
|
query: hosted_zone
|
hosted_zone_method: details
|
hosted_zone_id: "{{ _route53zone.zone_id }}"
|
register: _route53facts
|
retries: 5
|
delay: "{{ 60|random(start=3, step=1) }}"
|
until: _route53facts is succeeded
|
|
- name: Save NS records
|
set_fact:
|
ns_records: "{{ _route53facts.DelegationSet.NameServers }}"
|
|
- name: Generate commands to del NS records to IPA
|
copy:
|
content: |-
|
ipa dnsrecord-del opentlc.com. {{ account_name }}
|
dest: "{{ output_dir }}/ipa_del_{{ account_name }}.sh"
|
|
- name: Add HostedZoneId to the report
|
lineinfile:
|
path: "{{ output_dir }}/{{ account_name }}_report.txt"
|
line: "HostedZoneId: {{ _route53zone.zone_id }}"
|
regexp: '^HostedZoneId: '
|
|
- name: Add Zone name to the report
|
lineinfile:
|
path: "{{ output_dir }}/{{ account_name }}_report.txt"
|
line: "subdomain_base_suffix: .{{ account_name }}{{subdomain_base}}"
|
regexp: '^subdomain_base_suffix: '
|