DCD-1123: Add ability to add new instance to DNS.

This commit is contained in:
Steve Smith
2020-10-21 10:48:42 +11:00
parent df0d681369
commit 662a5b72e7
2 changed files with 16 additions and 2 deletions

View File

@@ -10,7 +10,11 @@
resource_owner: "{{ ansible_user_id }}"
aws_region: "us-west-2"
ec2_termination_protection: True
dns_domain: "deplops.com"
roles:
- { role: aws-vpc }
- { role: ec2-instance, vars: { instance_name: "Jira Software Migration Source Instance" } }
- role: aws-vpc
- role: ec2-instance
vars:
instance_name: "Jira Software Migration Source Instance"
instance_hostname: "jira-software-before"

View File

@@ -37,3 +37,13 @@
service_name: "{{ instance_name}}"
resource_owner: "{{ resource_owner }}"
register: ec2_instance
- name: Add DNS entry for EC2 instance
route53:
command: create
zone: "{{ dns_domain }}"
type: CNAME
record: "{{ instance_hostname }}.{{ dns_domain }}"
value: "{{ ec2_instance.tagged_instances[0].dns_name }}"
ttl: 60
overwrite: true