summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason DeTiberus <jdetiber@redhat.com>2015-11-06 13:21:54 -0500
committerJason DeTiberus <jdetiber@redhat.com>2015-11-06 13:21:54 -0500
commit050209f3c86a9dccefdf8b9f05898d1503254a2c (patch)
tree3c0eb820efd78f4607ddccabe6649a6a8e6ca492
parentc728a2109e41ef60536d8ef82ae4966b0268ca87 (diff)
downloadopenshift-050209f3c86a9dccefdf8b9f05898d1503254a2c.tar.gz
openshift-050209f3c86a9dccefdf8b9f05898d1503254a2c.tar.bz2
openshift-050209f3c86a9dccefdf8b9f05898d1503254a2c.tar.xz
openshift-050209f3c86a9dccefdf8b9f05898d1503254a2c.zip
Fix issues related to upgrade packages being unavailable
-rw-r--r--playbooks/adhoc/upgrades/files/versions.sh6
-rw-r--r--playbooks/adhoc/upgrades/upgrade.yml16
2 files changed, 16 insertions, 6 deletions
diff --git a/playbooks/adhoc/upgrades/files/versions.sh b/playbooks/adhoc/upgrades/files/versions.sh
index 01ea1d91a..f90719cab 100644
--- a/playbooks/adhoc/upgrades/files/versions.sh
+++ b/playbooks/adhoc/upgrades/files/versions.sh
@@ -1,7 +1,9 @@
#!/bin/bash
-yum_installed=$(yum list installed "$@" | tail -n +2 | grep -v 'Installed Packages' | grep -v 'Red Hat Subscription Management' | awk '{ print $2 }' | tr '\n' ' ')
-yum_available=$(yum list available "$@" | tail -n +2 | grep -v 'Available Packages' | grep -v 'Red Hat Subscription Management' | grep -v 'el7ose' | awk '{ print $2 }' | tr '\n' ' ')
+yum_installed=$(yum list installed "$@" 2>&1 | tail -n +2 | grep -v 'Installed Packages' | grep -v 'Red Hat Subscription Management' | grep -v 'Error:' | awk '{ print $2 }' | tr '\n' ' ')
+
+yum_available=$(yum list available "$@" 2>&1 | tail -n +2 | grep -v 'Available Packages' | grep -v 'Red Hat Subscription Management' | grep -v 'el7ose' | grep -v 'Error:' | awk '{ print $2 }' | tr '\n' ' ')
+
echo "---"
echo "curr_version: ${yum_installed}"
diff --git a/playbooks/adhoc/upgrades/upgrade.yml b/playbooks/adhoc/upgrades/upgrade.yml
index c0fdab027..d854bf913 100644
--- a/playbooks/adhoc/upgrades/upgrade.yml
+++ b/playbooks/adhoc/upgrades/upgrade.yml
@@ -12,10 +12,12 @@
tasks:
# Checking the global deployment type rather than host facts, this is about
# what the user is requesting.
- - fail: msg="Deployment type enterprise not supported for upgrade"
+ - fail:
+ msg: "Deployment type enterprise not supported for upgrade"
when: deployment_type == "enterprise"
# Pacemaker is currently the only supported upgrade path for multiple masters
- - fail: msg="openshift_master_cluster_method must be set to 'pacemaker'"
+ - fail:
+ msg: "openshift_master_cluster_method must be set to 'pacemaker'"
when: openshift_master_ha | bool and ((openshift_master_cluster_method is not defined) or (openshift_master_cluster_method is defined and openshift_master_cluster_method != "pacemaker"))
- name: Run pre-upgrade checks on first master
@@ -119,12 +121,18 @@
- set_fact:
g_new_version: "{{ g_aos_versions.curr_version.split('-', 1).0 if g_aos_versions.avail_version is none else g_aos_versions.avail_version.split('-', 1).0 }}"
- - fail: This playbook requires Origin 1.0.6 or later
+ - fail:
+ msg: This playbook requires Origin 1.0.6 or later
when: deployment_type == 'origin' and g_aos_versions.curr_version | version_compare('1.0.6','<')
- - fail: This playbook requires Atomic OpenShift 3.0.2 or later
+ - fail:
+ msg: This playbook requires Atomic OpenShift 3.0.2 or later
when: deployment_type in ['openshift-enterprise', 'atomic-openshift'] and g_aos_versions.curr_version | version_compare('3.0.2','<')
+ - fail:
+ msg: Atomic OpenShift 3.1 packages not found
+ when: deployment_type in ['openshift-enterprise', 'atomic-openshift'] and g_aos_versions.curr_version | version_compare('3.0.2.900','<') and (g_aos_versions.avail_version is none or g_aos_versions.avail_version | version_compare('3.0.2.900','<'))
+
- name: Upgrade masters
hosts: masters