Register DNS automatically for 9iron instances
This opens the door to making new CNAME entries for other services automagically
This commit is contained in:
parent
997fc8b3ee
commit
6ce15dcd96
17
roles/dns/tasks/main.yml
Normal file
17
roles/dns/tasks/main.yml
Normal file
@ -0,0 +1,17 @@
|
||||
#!/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: 9iron.club
|
||||
type: A
|
||||
record: "{{ inventory_hostname }}.9iron.club."
|
||||
ttl: 300
|
||||
value:
|
||||
- "{{ ipify_public_ip }}"
|
||||
wait: yes
|
4
site.yml
4
site.yml
@ -21,6 +21,10 @@
|
||||
64303363653631653433343361616635373966326433663466636164613062343561333036613937
|
||||
35616666633737356331653632323639373330396433366639326466373639313630
|
||||
tags: [ common, user ]
|
||||
- hosts: 9iron
|
||||
roles:
|
||||
- role: dns
|
||||
tags: [ common, dns ]
|
||||
- import_playbook: playbooks/home.yml
|
||||
- import_playbook: playbooks/webservers.yml
|
||||
- import_playbook: playbooks/gameservers.yml
|
||||
|
Loading…
Reference in New Issue
Block a user