summaryrefslogtreecommitdiffstats
path: root/playbooks/gce/openshift-cluster
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2015-12-14 09:08:56 -0500
committerKenny Woodson <kwoodson@redhat.com>2015-12-14 09:08:56 -0500
commite4ecb0ea7415e0db3957926e5c6a571c36e2ffd1 (patch)
treea1b1bcc5970889d913193b324423bee1ee3c8dbb /playbooks/gce/openshift-cluster
parent40ce28e760021571504efe3b89a4034b98c64f4b (diff)
parent7c945d07d2a61e7334a10388d37ac28f1bc58ce1 (diff)
downloadopenshift-e4ecb0ea7415e0db3957926e5c6a571c36e2ffd1.tar.gz
openshift-e4ecb0ea7415e0db3957926e5c6a571c36e2ffd1.tar.bz2
openshift-e4ecb0ea7415e0db3957926e5c6a571c36e2ffd1.tar.xz
openshift-e4ecb0ea7415e0db3957926e5c6a571c36e2ffd1.zip
Merge pull request #1028 from kwoodson/remove_env_host_type
Removing env-host-type in preparation of env and environment changes.
Diffstat (limited to 'playbooks/gce/openshift-cluster')
-rw-r--r--playbooks/gce/openshift-cluster/config.yml8
-rw-r--r--playbooks/gce/openshift-cluster/join_node.yml9
-rw-r--r--playbooks/gce/openshift-cluster/service.yml6
-rw-r--r--playbooks/gce/openshift-cluster/tasks/launch_instances.yml1
-rw-r--r--playbooks/gce/openshift-cluster/update.yml9
-rw-r--r--playbooks/gce/openshift-cluster/wip.yml2
6 files changed, 20 insertions, 15 deletions
diff --git a/playbooks/gce/openshift-cluster/config.yml b/playbooks/gce/openshift-cluster/config.yml
index 2a85d29dd..5bf98c2d5 100644
--- a/playbooks/gce/openshift-cluster/config.yml
+++ b/playbooks/gce/openshift-cluster/config.yml
@@ -17,10 +17,10 @@
- include: ../../common/openshift-cluster/config.yml
vars:
- g_etcd_group: "{{ 'tag_env-host-type-' ~ cluster_id ~ '-openshift-etcd' }}"
- g_lb_group: "{{ 'tag_env-host-type-' ~ cluster_id ~ '-openshift-lb' }}"
- g_masters_group: "{{ 'tag_env-host-type-' ~ cluster_id ~ '-openshift-master' }}"
- g_nodes_group: "{{ 'tag_env-host-type-' ~ cluster_id ~ '-openshift-node' }}"
+ g_etcd_hosts: "{{ (groups['tag_host-type-etcd']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}"
+ g_lb_hosts: "{{ (groups['tag_host-type-lb']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}"
+ g_master_hosts: "{{ (groups['tag_host-type-master']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}"
+ g_node_hosts: "{{ (groups['tag_host-type-node']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}"
g_ssh_user: "{{ hostvars.localhost.g_ssh_user_tmp }}"
g_sudo: "{{ hostvars.localhost.g_sudo_tmp }}"
g_nodeonmaster: true
diff --git a/playbooks/gce/openshift-cluster/join_node.yml b/playbooks/gce/openshift-cluster/join_node.yml
index 386628e8c..ab593b897 100644
--- a/playbooks/gce/openshift-cluster/join_node.yml
+++ b/playbooks/gce/openshift-cluster/join_node.yml
@@ -4,6 +4,11 @@
connection: local
become: no
gather_facts: no
+ vars:
+ g_etcd_hosts: "{{ (groups['tag_host-type-etcd']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}"
+ g_lb_hosts: "{{ (groups['tag_host-type-lb']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}"
+ g_master_hosts: "{{ (groups['tag_host-type-master']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}"
+ g_node_hosts: "{{ (groups['tag_host-type-node']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}"
vars_files:
- vars.yml
tasks:
@@ -33,11 +38,11 @@
- name: Evaluate oo_first_master
add_host:
- name: "{{ groups['tag_env-host-type-' ~ cluster_id ~ '-openshift-master'][0] }}"
+ name: "{{ g_master_hosts | first }}"
ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
groups: oo_first_master
- when: "'tag_env-host-type-{{ cluster_id }}-openshift-master' in groups"
+ when: g_master_hosts is defined and g_master_hosts|length > 0
#- include: config.yml
- include: ../../common/openshift-node/config.yml
diff --git a/playbooks/gce/openshift-cluster/service.yml b/playbooks/gce/openshift-cluster/service.yml
index 4bf5c8131..337ba7e44 100644
--- a/playbooks/gce/openshift-cluster/service.yml
+++ b/playbooks/gce/openshift-cluster/service.yml
@@ -10,21 +10,19 @@
- fail: msg="cluster_id is required to be injected in this playbook"
when: cluster_id is not defined
- - set_fact: scratch_group=tag_env-host-type-{{ cluster_id }}-openshift-node
- add_host:
name: "{{ item }}"
groups: g_service_nodes
ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user | default(ansible_ssh_user, true) }}"
ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
- with_items: groups[scratch_group] | default([]) | difference(['localhost']) | difference(groups.status_terminated)
+ with_items: "{{ g_node_hosts | default([]) | difference(['localhost']) | difference(groups.status_terminated) }}"
- - set_fact: scratch_group=tag_env-host-type-{{ cluster_id }}-openshift-master
- add_host:
name: "{{ item }}"
groups: g_service_masters
ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user | default(ansible_ssh_user, true) }}"
ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
- with_items: groups[scratch_group] | default([]) | difference(['localhost']) | difference(groups.status_terminated)
+ with_items: "{{ g_master_hosts | default([]) | difference(['localhost']) | difference(groups.status_terminated) }}"
- include: ../../common/openshift-node/service.yml
- include: ../../common/openshift-master/service.yml
diff --git a/playbooks/gce/openshift-cluster/tasks/launch_instances.yml b/playbooks/gce/openshift-cluster/tasks/launch_instances.yml
index de8a75b18..2360a3263 100644
--- a/playbooks/gce/openshift-cluster/tasks/launch_instances.yml
+++ b/playbooks/gce/openshift-cluster/tasks/launch_instances.yml
@@ -19,7 +19,6 @@
- env-{{ cluster }}
- host-type-{{ type }}
- sub-host-type-{{ g_sub_host_type }}
- - env-host-type-{{ cluster }}-openshift-{{ type }}
when: instances |length > 0
register: gce
diff --git a/playbooks/gce/openshift-cluster/update.yml b/playbooks/gce/openshift-cluster/update.yml
index 50958284d..d60662397 100644
--- a/playbooks/gce/openshift-cluster/update.yml
+++ b/playbooks/gce/openshift-cluster/update.yml
@@ -4,6 +4,11 @@
become: no
connection: local
gather_facts: no
+ vars:
+ g_etcd_hosts: "{{ (groups['tag_host-type-etcd']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}"
+ g_lb_hosts: "{{ (groups['tag_host-type-lb']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}"
+ g_master_hosts: "{{ (groups['tag_host-type-master']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}"
+ g_node_hosts: "{{ (groups['tag_host-type-node']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}"
vars_files:
- vars.yml
tasks:
@@ -13,9 +18,7 @@
groups: oo_hosts_to_update
ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user | default(ansible_ssh_user, true) }}"
ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
- with_items: (groups["tag_env-host-type-{{ cluster_id }}-openshift-master"] | default([]))
- | union(groups["tag_env-host-type-{{ cluster_id }}-openshift-node"] | default([]))
- | union(groups["tag_env-host-type-{{ cluster_id }}-openshift-etcd"] | default([]))
+ with_items: "{{ g_master_hosts | union(g_node_hosts) | union(g_etcd_hosts) | default([]) }}"
- include: ../../common/openshift-cluster/update_repos_and_packages.yml
diff --git a/playbooks/gce/openshift-cluster/wip.yml b/playbooks/gce/openshift-cluster/wip.yml
index 34cef52bc..0e3757546 100644
--- a/playbooks/gce/openshift-cluster/wip.yml
+++ b/playbooks/gce/openshift-cluster/wip.yml
@@ -13,7 +13,7 @@
groups: oo_masters_for_deploy
ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user | default(ansible_ssh_user, true) }}"
ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
- with_items: groups["tag_env-host-type-{{ cluster_id }}-openshift-master"] | default([])
+ with_items: "{{ g_master_hosts | default([]) }}"
- name: Deploy OpenShift Services
hosts: oo_masters_for_deploy