2020-06-29 11:15:36 -05:00
|
|
|
#!/usr/bin/ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
---
|
|
|
|
- name: Add machine to DNS zone
|
|
|
|
block:
|
|
|
|
- name: Get public IP
|
|
|
|
ipify_facts:
|
|
|
|
- name: Register record in zone
|
|
|
|
route53:
|
|
|
|
state: present
|
2020-06-30 05:52:18 -05:00
|
|
|
zone: "{{ zone }}"
|
2020-06-29 11:15:36 -05:00
|
|
|
type: A
|
2020-06-30 05:52:18 -05:00
|
|
|
record: "{{ inventory_hostname }}.{{ zone }}."
|
2020-06-29 11:15:36 -05:00
|
|
|
ttl: 300
|
|
|
|
value:
|
|
|
|
- "{{ ipify_public_ip }}"
|
|
|
|
wait: yes
|
2020-06-29 11:24:27 -05:00
|
|
|
become: yes
|