ansible/roles/dns/tasks/main.yml

20 lines
405 B
YAML
Raw Normal View History

#!/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-07-23 21:02:56 -05:00
overwrite: yes
zone: "{{ zone }}"
type: A
record: "{{ inventory_hostname }}.{{ zone }}."
ttl: 300
value:
- "{{ ipify_public_ip }}"
wait: yes
become: yes