summaryrefslogtreecommitdiffstats
path: root/roles/openshift_version
diff options
context:
space:
mode:
authorMichael Gugino <mgugino@redhat.com>2018-02-12 17:46:24 -0500
committerMichael Gugino <mgugino@redhat.com>2018-02-13 16:32:36 -0500
commitcdb1ae5fd0057aa6b666ca53fc54e73ce8be19fa (patch)
tree272b8d3867998590b690af95d56297fbc2a2e348 /roles/openshift_version
parent864d3bd62d28ea2ac10eaef4b767ce3fc7189bba (diff)
downloadopenshift-cdb1ae5fd0057aa6b666ca53fc54e73ce8be19fa.tar.gz
openshift-cdb1ae5fd0057aa6b666ca53fc54e73ce8be19fa.tar.bz2
openshift-cdb1ae5fd0057aa6b666ca53fc54e73ce8be19fa.tar.xz
openshift-cdb1ae5fd0057aa6b666ca53fc54e73ce8be19fa.zip
Simplify double upgrade version logic
Currently, double upgrade process (3.7 -> 3.9) for control plane attempts to run openshift_version role twice to set the appropriate values for upgrading each major version, 3.8 and 3.9. This commit instructs openshift_version to only inquire about the proper settings for 3.9, and hard-sets the appropriate values for 3.8. This allows a simplification of the openshift_version role, allowing for easier debugging. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1542368
Diffstat (limited to 'roles/openshift_version')
-rw-r--r--roles/openshift_version/defaults/main.yml3
-rw-r--r--roles/openshift_version/tasks/first_master.yml22
-rw-r--r--roles/openshift_version/tasks/first_master_rpm_version.yml4
-rw-r--r--roles/openshift_version/tasks/masters_and_nodes.yml2
4 files changed, 24 insertions, 7 deletions
diff --git a/roles/openshift_version/defaults/main.yml b/roles/openshift_version/defaults/main.yml
index e2e6538c9..c807df9d3 100644
--- a/roles/openshift_version/defaults/main.yml
+++ b/roles/openshift_version/defaults/main.yml
@@ -10,3 +10,6 @@ openshift_service_type: "{{ openshift_service_type_dict[openshift_deployment_typ
openshift_use_crio_only: False
l_first_master_version_task_file: "{{ openshift_is_containerized | ternary('first_master_containerized_version.yml', 'first_master_rpm_version.yml') }}"
+
+# Used during double control plane upgrades.
+l_double_upgrade_cp_reset_version: False
diff --git a/roles/openshift_version/tasks/first_master.yml b/roles/openshift_version/tasks/first_master.yml
index 374725086..022ac30fc 100644
--- a/roles/openshift_version/tasks/first_master.yml
+++ b/roles/openshift_version/tasks/first_master.yml
@@ -13,18 +13,30 @@
- include_tasks: "{{ l_first_master_version_task_file }}"
+# When double upgrade is in process, we want to set everything to match
+# openshift_verison.
- block:
- debug:
msg: "openshift_pkg_version was not defined. Falling back to -{{ openshift_version }}"
- set_fact:
- openshift_pkg_version: -{{ openshift_version }}
+ openshift_pkg_version: "-{{ openshift_version }}"
when:
- - openshift_pkg_version is not defined
- - openshift_upgrade_target is not defined
+ - openshift_pkg_version is not defined or l_double_upgrade_cp_reset_version
+# When double upgrade is in process, we want to set everything to match
+# openshift_verison.
- block:
- debug:
msg: "openshift_image_tag was not defined. Falling back to v{{ openshift_version }}"
- set_fact:
- openshift_image_tag: v{{ openshift_version }}
- when: openshift_image_tag is not defined
+ openshift_image_tag: "v{{ openshift_version }}"
+ when: openshift_image_tag is not defined or l_double_upgrade_cp_reset_version
+
+# The end result of these three variables is quite important so make sure they are displayed and logged:
+- debug: var=openshift_release
+
+- debug: var=openshift_image_tag
+
+- debug: var=openshift_pkg_version
+
+- debug: var=openshift_version
diff --git a/roles/openshift_version/tasks/first_master_rpm_version.yml b/roles/openshift_version/tasks/first_master_rpm_version.yml
index 264baca65..9a5f0c568 100644
--- a/roles/openshift_version/tasks/first_master_rpm_version.yml
+++ b/roles/openshift_version/tasks/first_master_rpm_version.yml
@@ -11,6 +11,8 @@
- name: Set openshift_version for rpm installation
include_tasks: check_available_rpms.yml
+# If double upgrade is in process, we want to set openshift_version to whatever
+# rpm package is available.
- set_fact:
openshift_version: "{{ rpm_results.results.versions.available_versions.0 }}"
- when: openshift_version is not defined
+ when: openshift_version is not defined or l_double_upgrade_cp_reset_version
diff --git a/roles/openshift_version/tasks/masters_and_nodes.yml b/roles/openshift_version/tasks/masters_and_nodes.yml
index fbeb22d8b..c4dbc2a5f 100644
--- a/roles/openshift_version/tasks/masters_and_nodes.yml
+++ b/roles/openshift_version/tasks/masters_and_nodes.yml
@@ -6,7 +6,7 @@
include_tasks: check_available_rpms.yml
- name: Fail if rpm version and docker image version are different
fail:
- msg: "OCP rpm version {{ openshift_rpm_version }} is different from OCP image version {{ openshift_version }}"
+ msg: "OCP rpm version {{ rpm_results.results.versions.available_versions.0 }} is different from OCP image version {{ openshift_version }}"
# Both versions have the same string representation
when: rpm_results.results.versions.available_versions.0 != openshift_version
# block when