summaryrefslogtreecommitdiffstats
path: root/playbooks/aws/openshift-master
diff options
context:
space:
mode:
authorWesley Hearn <wesley.s.hearn@gmail.com>2015-04-24 14:06:02 -0400
committerWesley Hearn <wesley.s.hearn@gmail.com>2015-04-24 14:06:02 -0400
commit196d37e2ffa0d7f4221a857b143fd09f84a9d00b (patch)
tree4c5413c72a2dd2ec732730b6994a104cca6a9798 /playbooks/aws/openshift-master
parent7f7b582a7bc239e69c147b98c8c2512050f12851 (diff)
parent8ce5e1de898d2fd2c4aa4620f31b57b62ed0c5d6 (diff)
downloadopenshift-196d37e2ffa0d7f4221a857b143fd09f84a9d00b.tar.gz
openshift-196d37e2ffa0d7f4221a857b143fd09f84a9d00b.tar.bz2
openshift-196d37e2ffa0d7f4221a857b143fd09f84a9d00b.tar.xz
openshift-196d37e2ffa0d7f4221a857b143fd09f84a9d00b.zip
Merge pull request #187 from openshift/master
Merge master into INT
Diffstat (limited to 'playbooks/aws/openshift-master')
-rw-r--r--playbooks/aws/openshift-master/config.yml27
-rw-r--r--playbooks/aws/openshift-master/launch.yml8
-rw-r--r--playbooks/aws/openshift-master/terminate.yml52
-rw-r--r--playbooks/aws/openshift-master/vars.yml3
4 files changed, 15 insertions, 75 deletions
diff --git a/playbooks/aws/openshift-master/config.yml b/playbooks/aws/openshift-master/config.yml
index 1c4060eee..37ab4fbe6 100644
--- a/playbooks/aws/openshift-master/config.yml
+++ b/playbooks/aws/openshift-master/config.yml
@@ -1,24 +1,19 @@
---
-- name: Populate oo_masters_to_config host group if needed
+- name: Populate oo_masters_to_config host group
hosts: localhost
gather_facts: no
tasks:
- - name: "Evaluate oo_host_group_exp if it's set"
- add_host: "name={{ item }} groups=oo_masters_to_config"
- with_items: "{{ oo_host_group_exp | default('') }}"
- when: oo_host_group_exp is defined
+ - name: Evaluate oo_masters_to_config
+ add_host:
+ name: "{{ item }}"
+ groups: oo_masters_to_config
+ ansible_ssh_user: root
+ with_items: oo_host_group_exp | default([])
-- name: Configure instances
- hosts: oo_masters_to_config
+- include: ../../common/openshift-master/config.yml
vars:
+ openshift_cluster_id: "{{ cluster_id }}"
+ openshift_debug_level: 4
+ openshift_deployment_type: "{{ deployment_type }}"
openshift_hostname: "{{ ec2_private_ip_address }}"
openshift_public_hostname: "{{ ec2_ip_address }}"
- # TODO: this should be removed once openshift-sdn packages are available
- openshift_use_openshift_sdn: False
- vars_files:
- - vars.yml
- roles:
- - openshift_master
- #- openshift_sdn_master
- - pods
- - os_env_extras
diff --git a/playbooks/aws/openshift-master/launch.yml b/playbooks/aws/openshift-master/launch.yml
index 3d87879a0..6b3751682 100644
--- a/playbooks/aws/openshift-master/launch.yml
+++ b/playbooks/aws/openshift-master/launch.yml
@@ -4,14 +4,12 @@
connection: local
gather_facts: no
+# TODO: modify atomic_ami based on deployment_type
vars:
inst_region: us-east-1
atomic_ami: ami-86781fee
user_data_file: user_data.txt
- vars_files:
- - vars.yml
-
tasks:
- name: Launch instances
ec2:
@@ -40,7 +38,7 @@
Name: "{{ item.0 }}"
- name: Add other tags to instances
- ec2_tag: "resource={{ item.id }} region={{ inst_region }} state=present"
+ ec2_tag: resource={{ item.id }} region={{ inst_region }} state=present
with_items: ec2.instances
args:
tags: "{{ oo_new_inst_tags }}"
@@ -57,7 +55,7 @@
- ec2.instances
- name: Wait for ssh
- wait_for: "port=22 host={{ item.dns_name }}"
+ wait_for: port=22 host={{ item.dns_name }}
with_items: ec2.instances
- name: Wait for root user setup
diff --git a/playbooks/aws/openshift-master/terminate.yml b/playbooks/aws/openshift-master/terminate.yml
index fd15cf00f..07d9961bc 100644
--- a/playbooks/aws/openshift-master/terminate.yml
+++ b/playbooks/aws/openshift-master/terminate.yml
@@ -1,52 +1,2 @@
---
-- name: Populate oo_masters_to_terminate host group if needed
- hosts: localhost
- gather_facts: no
- tasks:
- - name: Evaluate oo_host_group_exp if it's set
- add_host: "name={{ item }} groups=oo_masters_to_terminate"
- with_items: "{{ oo_host_group_exp | default('') }}"
- when: oo_host_group_exp is defined
-
-- name: Gather facts for instances to terminate
- hosts: oo_masters_to_terminate
-
-- name: Terminate instances
- hosts: localhost
- connection: local
- gather_facts: no
- vars:
- host_vars: "{{ hostvars
- | oo_select_keys(groups['oo_masters_to_terminate']) }}"
- tasks:
- - name: Terminate instances
- ec2:
- state: absent
- instance_ids: ["{{ item.ec2_id }}"]
- region: "{{ item.ec2_region }}"
- ignore_errors: yes
- register: ec2_term
- with_items: host_vars
-
- # Fail if any of the instances failed to terminate with an error other
- # than 403 Forbidden
- - fail: msg=Terminating instance {{ item.item.ec2_id }} failed with message {{ item.msg }}
- when: "item.failed and not item.msg | search(\"error: EC2ResponseError: 403 Forbidden\")"
- with_items: ec2_term.results
-
- - name: Stop instance if termination failed
- ec2:
- state: stopped
- instance_ids: ["{{ item.item.ec2_id }}"]
- region: "{{ item.item.ec2_region }}"
- register: ec2_stop
- when: item.failed
- with_items: ec2_term.results
-
- - name: Rename stopped instances
- ec2_tag: resource={{ item.item.item.ec2_id }} region={{ item.item.item.ec2_region }} state=present
- args:
- tags:
- Name: "{{ item.item.item.ec2_tag_Name }}-terminate"
- with_items: ec2_stop.results
-
+- include: ../terminate.yml
diff --git a/playbooks/aws/openshift-master/vars.yml b/playbooks/aws/openshift-master/vars.yml
deleted file mode 100644
index c196b2fca..000000000
--- a/playbooks/aws/openshift-master/vars.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-openshift_debug_level: 4
-openshift_cluster_id: "{{ cluster_id }}"