diff options
author | Devan Goodwin <dgoodwin@redhat.com> | 2016-06-13 15:15:50 -0300 |
---|---|---|
committer | Devan Goodwin <dgoodwin@redhat.com> | 2016-06-13 15:15:50 -0300 |
commit | af2cc5587132427faae21785599280b1f05e6cda (patch) | |
tree | 68e0ec5396f8cd7e30f8a1e79e17b18a59f0f996 /playbooks/common/openshift-cluster | |
parent | ba525e1ebfe44b1993f0b37801122c4030e72d48 (diff) | |
download | openshift-af2cc5587132427faae21785599280b1f05e6cda.tar.gz openshift-af2cc5587132427faae21785599280b1f05e6cda.tar.bz2 openshift-af2cc5587132427faae21785599280b1f05e6cda.tar.xz openshift-af2cc5587132427faae21785599280b1f05e6cda.zip |
Restore 3.2 RPM version check before upgrading.
Diffstat (limited to 'playbooks/common/openshift-cluster')
-rw-r--r-- | playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml | 19 |
1 files changed, 17 insertions, 2 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 |