Browse Source

Remove vars_files on play includes for upgrade playbooks.

Andrew Butcher 9 years ago
parent
commit
ae34281f89

+ 18 - 7
playbooks/byo/openshift-cluster/upgrades/v3_0_minor/upgrade.yml

@@ -1,13 +1,24 @@
 ---
+- hosts: localhost
+  connection: local
+  become: no
+  gather_facts: no
+  tasks:
+  - include_vars: ../../../../byo/openshift-cluster/cluster_hosts.yml
+  - add_host:
+      name: "{{ item }}"
+      groups: l_oo_all_hosts
+    with_items: "{{ g_all_hosts }}"
+
+- hosts: l_oo_all_hosts
+  gather_facts: no
+  tasks:
+  - include_vars: ../../../../byo/openshift-cluster/cluster_hosts.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml
-  vars_files:
-  - "{{lookup('file', '../../../../byo/openshift-cluster/cluster_hosts.yml')}}"
   vars:
-    g_etcd_hosts: "{{ groups.etcd | default([]) }}"
-    g_master_hosts: "{{ groups.masters | default([]) }}"
+    # Do not allow adding hosts during upgrade.
     g_new_master_hosts: []
-    g_nfs_hosts: "{{ groups.nfs | default([]) }}"
-    g_node_hosts: "{{ groups.nodes | default([]) }}"
-    g_lb_hosts: "{{ groups.lb | default([]) }}"
+    g_new_node_hosts: []
     openshift_cluster_id: "{{ cluster_id | default('default') }}"
     openshift_deployment_type: "{{ deployment_type }}"

+ 18 - 7
playbooks/byo/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml

@@ -1,13 +1,24 @@
 ---
+- hosts: localhost
+  connection: local
+  become: no
+  gather_facts: no
+  tasks:
+  - include_vars: ../../../../byo/openshift-cluster/cluster_hosts.yml
+  - add_host:
+      name: "{{ item }}"
+      groups: l_oo_all_hosts
+    with_items: "{{ g_all_hosts }}"
+
+- hosts: l_oo_all_hosts
+  gather_facts: no
+  tasks:
+  - include_vars: ../../../../byo/openshift-cluster/cluster_hosts.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml
-  vars_files:
-  - "{{lookup('file', '../../../../byo/openshift-cluster/cluster_hosts.yml')}}"
   vars:
-    g_etcd_hosts: "{{ groups.etcd | default([]) }}"
-    g_master_hosts: "{{ groups.masters | default([]) }}"
+    # Do not allow adding hosts during upgrade.
     g_new_master_hosts: []
-    g_nfs_hosts: "{{ groups.nfs | default([]) }}"
-    g_node_hosts: "{{ groups.nodes | default([]) }}"
-    g_lb_hosts: "{{ groups.lb | default([]) }}"
+    g_new_node_hosts: []
     openshift_cluster_id: "{{ cluster_id | default('default') }}"
     openshift_deployment_type: "{{ deployment_type }}"

+ 18 - 5
playbooks/byo/openshift-cluster/upgrades/v3_1_minor/upgrade.yml

@@ -1,12 +1,25 @@
 ---
+- hosts: localhost
+  connection: local
+  become: no
+  gather_facts: no
+  tasks:
+  - include_vars: ../../../../byo/openshift-cluster/cluster_hosts.yml
+  - add_host:
+      name: "{{ item }}"
+      groups: l_oo_all_hosts
+    with_items: "{{ g_all_hosts }}"
+
+- hosts: l_oo_all_hosts
+  gather_facts: no
+  tasks:
+  - include_vars: ../../../../byo/openshift-cluster/cluster_hosts.yml
+
 - include: ../../../../common/openshift-cluster/evaluate_groups.yml
   vars:
-    g_etcd_hosts: "{{ groups.etcd | default([]) }}"
-    g_master_hosts: "{{ groups.masters | default([]) }}"
+    # Do not allow adding hosts during upgrade.
     g_new_master_hosts: []
-    g_nfs_hosts: "{{ groups.nfs | default([]) }}"
-    g_node_hosts: "{{ groups.nodes | default([]) }}"
-    g_lb_hosts: "{{ groups.lb | default([]) }}"
+    g_new_node_hosts: []
     openshift_cluster_id: "{{ cluster_id | default('default') }}"
     openshift_deployment_type: "{{ deployment_type }}"
 - include: ../../../../common/openshift-cluster/upgrades/v3_1_minor/pre.yml

+ 18 - 7
playbooks/byo/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml

@@ -1,14 +1,25 @@
 ---
+- hosts: localhost
+  connection: local
+  become: no
+  gather_facts: no
+  tasks:
+  - include_vars: ../../../../byo/openshift-cluster/cluster_hosts.yml
+  - add_host:
+      name: "{{ item }}"
+      groups: l_oo_all_hosts
+    with_items: g_all_hosts | default([])
+
+- hosts: l_oo_all_hosts
+  gather_facts: no
+  tasks:
+  - include_vars: ../../../../byo/openshift-cluster/cluster_hosts.yml
+
 - include: ../../../../common/openshift-cluster/evaluate_groups.yml
   vars:
-    g_etcd_hosts: "{{ groups.etcd | default([]) }}"
-    g_master_hosts: "{{ groups.masters | default([]) }}"
+    # Do not allow adding hosts during upgrade.
     g_new_master_hosts: []
-    g_nfs_hosts: "{{ groups.nfs | default([]) }}"
-    g_node_hosts: "{{ groups.nodes | default([]) }}"
-    g_lb_hosts: "{{ groups.lb | default([]) }}"
-    g_all_hosts: "{{ groups.masters | default([]) | union(groups.nodes | default([])) | union(groups.etcd | default([]))
-                    | union(groups.lb | default([])) | union(groups.nfs | default([])) }}"
+    g_new_node_hosts: []
     openshift_cluster_id: "{{ cluster_id | default('default') }}"
     openshift_deployment_type: "{{ deployment_type }}"
 

+ 1 - 0
playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/atomic-openshift-master.j2

@@ -0,0 +1 @@
+../../../../../roles/openshift_master/templates/atomic-openshift-master.j2

+ 1 - 0
playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/docker

@@ -0,0 +1 @@
+../../../../../roles/openshift_master/templates/docker

+ 1 - 0
playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/docker-cluster

@@ -0,0 +1 @@
+../../../../../roles/openshift_master/templates/docker-cluster

+ 1 - 0
playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/native-cluster

@@ -0,0 +1 @@
+../../../../../roles/openshift_master/templates/native-cluster