瀏覽代碼

Check for bad versions of yum and subscription-manager.

Use of yum and repoquery will output the given additional warning when
using newer versions of subscription-manager, with older versions of
yum. (RHEL 7.1) Installing/upgrading newer docker can pull this
subscription-manager in resulting in problems with older versions of
ansible and it's yum module, as well as any use of repoquery/yum
commands in our playbooks.

This change explicitly checks for the problem by using repoquery and
fails early if found. This is run early in both config and upgrade.
Devan Goodwin 8 年之前
父節點
當前提交
b992ef77fd
共有 1 個文件被更改,包括 16 次插入0 次删除
  1. 16 0
      playbooks/common/openshift-cluster/initialize_openshift_version.yml

+ 16 - 0
playbooks/common/openshift-cluster/initialize_openshift_version.yml

@@ -1,5 +1,21 @@
 ---
 # NOTE: requires openshift_facts be run
+- hosts: l_oo_all_hosts
+  gather_facts: no
+  tasks:
+  # See:
+  #   https://bugzilla.redhat.com/show_bug.cgi?id=1395047
+  #   https://bugzilla.redhat.com/show_bug.cgi?id=1282961
+  #   https://github.com/openshift/openshift-ansible/issues/1138
+  - name: Check for bad combinations of yum and subscription-manager
+    command: >
+      {{ repoquery_cmd }} --installed --qf '%{version}' "yum"
+    register: yum_ver_test
+    changed_when: false
+  - fail:
+      msg: Incompatible versions of yum and subscription-manager found. You may need to update yum and yum-utils.
+    when: "'Plugin \"search-disabled-repos\" requires API 2.7. Supported API is 2.6.' in yum_ver_test.stdout"
+
 - name: Determine openshift_version to configure on first master
   hosts: oo_first_master
   roles: