Commit 82e09834 by John Jarvis

updating for dns name using route53 module

parent 3783b745
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
region: "{{ region }}" region: "{{ region }}"
instance_tags: "{{ instance_tags }}" instance_tags: "{{ instance_tags }}"
size: "{{ size }}" size: "{{ size }}"
dns_name: "{{ dns_name }}"
- name: Configure instance(s) - name: Configure instance(s)
hosts: launched hosts: launched
...@@ -19,3 +19,4 @@ ...@@ -19,3 +19,4 @@
gather_facts: True gather_facts: True
tasks: tasks:
- debug: msg="test" - debug: msg="test"
...@@ -14,14 +14,50 @@ ...@@ -14,14 +14,50 @@
size: "{{ size }}" size: "{{ size }}"
register: ec2 register: ec2
- name: launch_instance | Add new instance to host group - name: launch_ec2 | Add DNS name
local_action:
module: route53
command: create
zone: sandbox.edx.org
type: CNAME
ttyl: 300
record: "{{ dns_name }}"
value: "{{ item.public_dns_name }}"
with_items: "{{ ec2.instances }}"
- name: launch_ec2 | Add DNS name studio
local_action:
module: route53
command: create
zone: sandbox.edx.org
type: CNAME
ttyl: 300
record: "studio.{{ dns_name }}"
value: "{{ item.public_dns_name }}"
with_items: "{{ ec2.instances }}"
- name: launch_ec2 | Add DNS name preview
local_action:
module: route53
command: create
zone: sandbox.edx.org
type: CNAME
ttyl: 300
record: "preview.{{ dns_name }}"
value: "{{ item.public_dns_name }}"
with_items: "{{ ec2.instances }}"
- name: launch_ec2 | Add new instance to host group
local_action: > local_action: >
add_host add_host
hostname={{ item.public_ip }} hostname={{ item.public_ip }}
groupname=launched groupname=launched
with_items: "{{ ec2.instances }}" with_items: "{{ ec2.instances }}"
- name: launch_instance | Wait for SSH to come up - name: launch_ec2 | Wait for SSH to come up
local_action: > local_action: >
wait_for wait_for
host={{ item.public_dns_name }} host={{ item.public_dns_name }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment