summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2016-06-13 15:15:50 -0300
committerDevan Goodwin <dgoodwin@redhat.com>2016-06-13 15:15:50 -0300
commitaf2cc5587132427faae21785599280b1f05e6cda (patch)
tree68e0ec5396f8cd7e30f8a1e79e17b18a59f0f996
parentba525e1ebfe44b1993f0b37801122c4030e72d48 (diff)
downloadopenshift-af2cc5587132427faae21785599280b1f05e6cda.tar.gz
openshift-af2cc5587132427faae21785599280b1f05e6cda.tar.bz2
openshift-af2cc5587132427faae21785599280b1f05e6cda.tar.xz
openshift-af2cc5587132427faae21785599280b1f05e6cda.zip
Restore 3.2 RPM version check before upgrading.
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml19
-rw-r--r--roles/openshift_version/meta/main.yml1
2 files changed, 17 insertions, 3 deletions
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 c2847e163..9cba1b40b 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
@@ -144,11 +144,26 @@
docker pull {{ openshift.common.cli_image }}:v{{ openshift_version }}
when: openshift.common.is_containerized | bool
- - name: Verify RPMs are available for upgrade
+ - set_fact:
+ repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery' }}"
+ when: not openshift.common.is_containerized | bool
+
+ - name: Check latest available OpenShift RPM version
command: >
- yum list available -e 0 -q "{{ g_new_service_name }}" 2>&1 | tail -n +2 | grep -v 'el7ose' | awk '{ print $2 }' | sort -r | tr '\n' ' ')
+ {{ repoquery_cmd }} --qf '%{version}' "{{ openshift.common.service_type }}"
+ failed_when: false
+ changed_when: false
+ register: avail_openshift_version
when: not openshift.common.is_containerized | bool
+ - debug: var=avail_openshift_version
+
+ - name: Verify OpenShift 3.2 RPMs are available for upgrade
+ fail:
+ msg: "OpenShift {{ avail_openshift_version.stdout }} is available, but 3.2 or greater is required"
+ when: not openshift.common.is_containerized | bool and not avail_openshift_version | skipped and avail_openshift_version.stdout | default('0.0', True) | version_compare('3.2', '<')
+
+
# TODO: Are these two grep checks necessary anymore?
# Note: the version number is hardcoded here in hopes of catching potential
# bugs in how g_aos_versions.curr_version is set
diff --git a/roles/openshift_version/meta/main.yml b/roles/openshift_version/meta/main.yml
index bddb20708..70974da17 100644
--- a/roles/openshift_version/meta/main.yml
+++ b/roles/openshift_version/meta/main.yml
@@ -14,6 +14,5 @@ galaxy_info:
dependencies:
- role: openshift_repos
- role: openshift_docker_facts
- when: openshift.common.is_containerized | default(False) | bool
- role: docker
when: openshift.common.is_containerized | default(False) | bool