Commit 8098771a by John Jarvis

add elb support for provisioning, for sandboxes.edx.org

parent 5107992b
......@@ -32,3 +32,13 @@
# gh_users hash must be passed
# in as a -e variable
- gh_users
post_tasks:
- name: register instance into an elb if one was provided
local_action:
module: ec2_elb
region: "{{ region }}"
instance_id: "{{ item }}"
ec2_elbs:
- "{{ elb }}"
with_items: "{{ ec2.instances }}"
when: elb
......@@ -35,6 +35,7 @@
region: "{{ region }}"
instance_tags: "{{instance_tags}}"
root_ebs_size: "{{ root_ebs_size }}"
zone: "{{ zone }}"
register: ec2
- name: launch_ec2 | Add DNS name
......
......@@ -38,6 +38,18 @@ fi
extra_vars="/var/tmp/extra-vars-$$.yml"
if [[ -z $region ]]; then
region="us-east1"
fi
if [[ -z $zone ]]; then
zone="us-east-1b"
fi
if [[ -z $elb ]]; then
elb="!!null"
fi
if [[ -z $dns_name ]]; then
dns_name=$github_username
fi
......@@ -83,7 +95,8 @@ keypair: $keypair
instance_type: $instance_type
security_group: $security_group
ami: $ami
region: $region
region: $region
zone: $zone
instance_tags: '{"environment": "$environment", "github_username": "$github_username", "Name": "$name_tag", "source": "jenkins", "owner": "$BUILD_USER"}'
root_ebs_size: $root_ebs_size
name_tag: $name_tag
......@@ -92,6 +105,7 @@ gh_users:
dns_zone: $dns_zone
rabbitmq_refresh: True
GH_USERS_PROMPT: '[$name_tag] '
elb: "$elb"
EOF
cat $extra_vars
# run the tasks to launch an ec2 instance from AMI
......
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