summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2016-06-07 15:17:28 -0300
committerDevan Goodwin <dgoodwin@redhat.com>2016-06-07 15:17:28 -0300
commit258ea62f3bb1bfc89eb4e676c77d1610aa067c43 (patch)
tree0090d9658fb0bfaf7758f1153ba1360cb2084965
parentdd8501ca8199484531e0a6d2b40139d4085afefa (diff)
downloadopenshift-258ea62f3bb1bfc89eb4e676c77d1610aa067c43.tar.gz
openshift-258ea62f3bb1bfc89eb4e676c77d1610aa067c43.tar.bz2
openshift-258ea62f3bb1bfc89eb4e676c77d1610aa067c43.tar.xz
openshift-258ea62f3bb1bfc89eb4e676c77d1610aa067c43.zip
Respect image tag/pkg version during upgrade.
-rw-r--r--playbooks/common/openshift-cluster/initialize_openshift_version.yml12
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml8
-rw-r--r--roles/openshift_version/tasks/main.yml6
3 files changed, 15 insertions, 11 deletions
diff --git a/playbooks/common/openshift-cluster/initialize_openshift_version.yml b/playbooks/common/openshift-cluster/initialize_openshift_version.yml
index 098558c01..972df050c 100644
--- a/playbooks/common/openshift-cluster/initialize_openshift_version.yml
+++ b/playbooks/common/openshift-cluster/initialize_openshift_version.yml
@@ -13,14 +13,16 @@
# and we don't want to install wrong version of docker and have to downgrade
# later.
- name: Set openshift_version for all hosts
- hosts: oo_all_hosts
- tasks:
+ hosts: oo_all_hosts:!oo_first_master
+ vars:
+ openshift_version: "{{ hostvars[groups.oo_first_master.0].openshift_version }}"
+ roles:
+ - openshift_version
+ pre_tasks:
- debug: var=hostvars[groups.oo_first_master.0].openshift_version
- debug: var=openshift.common.version
- debug: var=openshift_version
- - set_fact:
- 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
+ post_tasks:
- debug: var=hostvars[groups.oo_first_master.0].openshift_version
- debug: var=openshift.common.version
- debug: var=openshift_version
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml
index f9ca26e34..8596443c0 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml
@@ -66,9 +66,11 @@
- include: ../../../../common/openshift-cluster/initialize_openshift_version.yml
vars:
- # 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"
+ # Request openshift_release 3.2 and let the openshift_version role handle converting this
+ # to a more specific version, respecting openshift_image_tag and openshift_pkg_version if
+ # defined, and overriding the normal behavior of protecting the installed version
+ openshift_release: "3.2"
+ openshift_protect_installed_version: False
- name: Verify upgrade can proceed on masters
hosts: oo_masters_to_config
diff --git a/roles/openshift_version/tasks/main.yml b/roles/openshift_version/tasks/main.yml
index 1cfbff1b0..39accf579 100644
--- a/roles/openshift_version/tasks/main.yml
+++ b/roles/openshift_version/tasks/main.yml
@@ -9,12 +9,12 @@
- debug: var=openshift_pkg_version
- debug: var=openshift_image_tag
-# Here we protect the version already installed unless something has already set
-# an openshift_version to configure.
+# Protect the installed version by default unless explicitly told not to, or given an
+# openshift_version already.
- name: Use openshift.common.version fact as version to configure if already installed
set_fact:
openshift_version: "{{ openshift.common.version }}"
- when: openshift.common.version is defined and openshift_version is not defined
+ when: openshift.common.version is defined and openshift_version is not defined and openshift_protect_installed_version
- name: Set openshift_version for rpm installation
include: set_version_rpm.yml