From dd9a27ad1448b2c953b0b45a46dba83f77cc5ad5 Mon Sep 17 00:00:00 2001
From: Scott Dodson <sdodson@redhat.com>
Date: Sun, 14 Jan 2018 22:00:48 -0500
Subject: Add call to 3.8 playbook in 3.9 upgrade

---
 .../openshift_version/tasks/first_master_containerized_version.yml | 5 +++--
 roles/openshift_version/tasks/first_master_rpm_version.yml         | 6 +++++-
 roles/openshift_version/tasks/masters_and_nodes.yml                | 7 +++++--
 3 files changed, 13 insertions(+), 5 deletions(-)

(limited to 'roles/openshift_version')

diff --git a/roles/openshift_version/tasks/first_master_containerized_version.yml b/roles/openshift_version/tasks/first_master_containerized_version.yml
index e02a75eab..3ed1d2cfe 100644
--- a/roles/openshift_version/tasks/first_master_containerized_version.yml
+++ b/roles/openshift_version/tasks/first_master_containerized_version.yml
@@ -7,6 +7,7 @@
   when:
   - openshift_image_tag is defined
   - openshift_version is not defined
+  - not (openshift_version_reinit | default(false))
 
 - name: Set containerized version to configure if openshift_release specified
   set_fact:
@@ -20,7 +21,7 @@
     docker run --rm {{ openshift_cli_image }}:latest version
   register: cli_image_version
   when:
-  - openshift_version is not defined
+  - openshift_version is not defined or openshift_version_reinit | default(false)
   - not openshift_use_crio_only
 
 # Origin latest = pre-release version (i.e. v1.3.0-alpha.1-321-gb095e3a)
@@ -34,7 +35,7 @@
 
 - set_fact:
     openshift_version: "{{ cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0][1:] }}"
-  when: openshift_version is not defined
+  when: openshift_version is not defined or openshift_version_reinit | default(false)
 
 # If we got an openshift_version like "3.2", lookup the latest 3.2 container version
 # and use that value instead.
diff --git a/roles/openshift_version/tasks/first_master_rpm_version.yml b/roles/openshift_version/tasks/first_master_rpm_version.yml
index 264baca65..5d92f90c6 100644
--- a/roles/openshift_version/tasks/first_master_rpm_version.yml
+++ b/roles/openshift_version/tasks/first_master_rpm_version.yml
@@ -6,6 +6,7 @@
   when:
   - openshift_pkg_version is defined
   - openshift_version is not defined
+  - not (openshift_version_reinit | default(false))
 
 # These tasks should only be run against masters and nodes
 - name: Set openshift_version for rpm installation
@@ -13,4 +14,7 @@
 
 - set_fact:
     openshift_version: "{{ rpm_results.results.versions.available_versions.0 }}"
-  when: openshift_version is not defined
+  when: openshift_version is not defined or ( openshift_version_reinit | default(false) )
+- set_fact:
+    openshift_pkg_version: "-{{ rpm_results.results.versions.available_versions.0 }}"
+  when: openshift_version_reinit | default(false)
diff --git a/roles/openshift_version/tasks/masters_and_nodes.yml b/roles/openshift_version/tasks/masters_and_nodes.yml
index fbeb22d8b..eddd5ff42 100644
--- a/roles/openshift_version/tasks/masters_and_nodes.yml
+++ b/roles/openshift_version/tasks/masters_and_nodes.yml
@@ -6,9 +6,12 @@
     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
+    when:
+    - openshift_version not in rpm_results.results.versions.available_versions.0
+    - openshift_version_reinit | default(false)
+
   # block when
   when: not openshift_is_atomic | bool
 
-- 
cgit v1.2.3