summaryrefslogtreecommitdiffstats
path: root/playbooks/aws
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-02-05 16:02:00 -0500
committerThomas Wiest <twiest@users.noreply.github.com>2015-02-05 16:02:00 -0500
commit04343e7588118359d178fa63554909efb222648a (patch)
tree21ae9b09d447700b13e91acf3308748d3a6af8fd /playbooks/aws
parent076434d7a1026540f0eee5479adddc895d73b9b0 (diff)
parentddf12084e107152f70f7cad82bd1fcdb54880db3 (diff)
downloadopenshift-04343e7588118359d178fa63554909efb222648a.tar.gz
openshift-04343e7588118359d178fa63554909efb222648a.tar.bz2
openshift-04343e7588118359d178fa63554909efb222648a.tar.xz
openshift-04343e7588118359d178fa63554909efb222648a.zip
Merge pull request #53 from twiest/atomic
Changed os2-atomic-proxy to be able to launch inside of both a vpc and classic. Changed STG to default to launching in a vpc, prod still launches in classic. Also cleaned up some cruft.
Diffstat (limited to 'playbooks/aws')
-rw-r--r--playbooks/aws/os2-atomic-proxy/launch.yml32
-rw-r--r--playbooks/aws/os2-atomic-proxy/vars.stg.yml7
2 files changed, 37 insertions, 2 deletions
diff --git a/playbooks/aws/os2-atomic-proxy/launch.yml b/playbooks/aws/os2-atomic-proxy/launch.yml
index 23bf67bb7..fd6b0f39a 100644
--- a/playbooks/aws/os2-atomic-proxy/launch.yml
+++ b/playbooks/aws/os2-atomic-proxy/launch.yml
@@ -8,12 +8,35 @@
inst_region: us-east-1
atomic_ami: ami-8e239fe6
user_data_file: user_data.txt
+ oo_vpc_subnet_id: # Purposely left blank, these are here to be overridden in env vars_files
+ oo_assign_public_ip: # Purposely left blank, these are here to be overridden in env vars_files
vars_files:
- vars.yml
+ - "vars.{{ oo_env }}.yml"
tasks:
- - name: Launch instances
+ - name: Launch instances in VPC
+ ec2:
+ state: present
+ region: "{{ inst_region }}"
+ keypair: mmcgrath_libra
+ group_id: "{{ oo_security_group_ids }}"
+ instance_type: m3.large
+ image: "{{ atomic_ami }}"
+ count: "{{ oo_new_inst_names | oo_len }}"
+ user_data: "{{ lookup('file', user_data_file) }}"
+ wait: yes
+ assign_public_ip: "{{ oo_assign_public_ip }}"
+ vpc_subnet_id: "{{ oo_vpc_subnet_id }}"
+ when: oo_vpc_subnet_id
+ register: ec2_vpc
+
+ - set_fact:
+ ec2: "{{ ec2_vpc }}"
+ when: oo_vpc_subnet_id
+
+ - name: Launch instances in Classic
ec2:
state: present
region: "{{ inst_region }}"
@@ -24,7 +47,12 @@
count: "{{ oo_new_inst_names | oo_len }}"
user_data: "{{ lookup('file', user_data_file) }}"
wait: yes
- register: ec2
+ when: not oo_vpc_subnet_id
+ register: ec2_classic
+
+ - set_fact:
+ ec2: "{{ ec2_classic }}"
+ when: not oo_vpc_subnet_id
- name: Add new instances public IPs to the atomic proxy host group
add_host: "hostname={{ item.public_ip }} groupname=new_ec2_instances"
diff --git a/playbooks/aws/os2-atomic-proxy/vars.stg.yml b/playbooks/aws/os2-atomic-proxy/vars.stg.yml
index 8d994c2fc..1cecfc9b2 100644
--- a/playbooks/aws/os2-atomic-proxy/vars.stg.yml
+++ b/playbooks/aws/os2-atomic-proxy/vars.stg.yml
@@ -1,3 +1,10 @@
---
oo_env_long: staging
oo_zabbix_hostgroups: ['STG Environment']
+oo_vpc_subnet_id: subnet-700bdd07
+oo_assign_public_ip: yes
+oo_security_group_ids:
+ - sg-02c2f267 # Libra (vpc)
+ - sg-f0bfbe95 # stg (vpc)
+ - sg-a3bfbec6 # stg_proxy (vpc)
+ - sg-d4bfbeb1 # stg_proxy_atomic (vpc)