Browse Source

Force version to latest 3.2 during upgrade.

Devan Goodwin 8 years ago
parent
commit
dd8501ca81

+ 1 - 1
playbooks/common/openshift-cluster/initialize_openshift_version.yml

@@ -19,7 +19,7 @@
   - debug: var=openshift.common.version
   - debug: var=openshift_version
   - set_fact:
-      openshift_version: "{{ openshift.common.version if openshift.common.version is defined else hostvars[groups.oo_first_master.0].openshift_version }}"
+      openshift_version: "{{ openshift.common.version if (openshift.common.version is defined and openshift_version is not defined) else hostvars[groups.oo_first_master.0].openshift_version }}"
     when: inventory_hostname != groups.oo_first_master.0
   - debug: var=hostvars[groups.oo_first_master.0].openshift_version
   - debug: var=openshift.common.version

+ 3 - 1
playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml

@@ -66,7 +66,9 @@
 
 - include: ../../../../common/openshift-cluster/initialize_openshift_version.yml
   vars:
-    openshift_release: "3.2"
+    # Force the openshift_version role to 3.2, it will convert this to a more specific variable and
+    # make sure the openshift_image_tag and openshift_pkg_version are all set appropriately.
+    openshift_version: "3.2"
 
 - name: Verify upgrade can proceed on masters
   hosts: oo_masters_to_config

+ 4 - 0
roles/openshift_version/tasks/main.yml

@@ -26,4 +26,8 @@
 
 - debug: var=openshift_version
 
+# At this point we know openshift_version is set appropriately. Now we set
+# openshift_image_tag and openshift_pkg_version, so all roles can always assume
+# each of this variables *will* be set correctly and can use them per their
+# intended purpose.