ansible/roles/dns/tasks/main.yml
2020-06-30 05:52:18 -05:00

19 lines
384 B
YAML

#!/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
zone: "{{ zone }}"
type: A
record: "{{ inventory_hostname }}.{{ zone }}."
ttl: 300
value:
- "{{ ipify_public_ip }}"
wait: yes
become: yes