ansible/roles/dns/tasks/main.yml
Salt 863623e3b0 Factor extended hostnames into existing roles
Ow, really feeling that maintainability hit
2020-07-28 06:44:33 -05:00

20 lines
411 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
overwrite: yes
zone: "{{ zone }}"
type: A
record: "{{ inventory_hostname_short }}.{{ zone }}."
ttl: 300
value:
- "{{ ipify_public_ip }}"
wait: yes
become: yes