From 31ce2569c143e26b4758ed627f9ef663aacf1fe6 Mon Sep 17 00:00:00 2001 From: pinikomarov Date: Mon, 8 Jun 2020 02:57:35 +0300 Subject: [PATCH] Fix rhel optional repo not found and not reported as error error links: http://pastebin.test.redhat.com/872688 http://pastebin.test.redhat.com/872689 problem 1) currently even a made up repo enable command returns zero: [stack@undercloud-0 ~]$ sudo yum-config-manager --enable petepan-repo-rhel-7 [stack@undercloud-0 ~]$ echo $? 0 we can switch to using "shell" ansible module, and grep for the baseurl so that the if it fails we'll actually catch the error problem 2) no such thing as rhel-7-server-optional-rpms repo (exists only in som latest versions) what does exist is : rhelosp-rhel-7.8-server-opt and we can use : rhelosp-rhel-*-server-opt to be version agnostic Change-Id: Icd5c62d3d421e0f561032620ab3548d32b4ff387 --- roles/tobiko-ensure-python3/tasks/install.yaml | 4 ++-- roles/tobiko-ensure-python3/vars/RedHat-7.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/tobiko-ensure-python3/tasks/install.yaml b/roles/tobiko-ensure-python3/tasks/install.yaml index 151ba1412..1a7d38919 100644 --- a/roles/tobiko-ensure-python3/tasks/install.yaml +++ b/roles/tobiko-ensure-python3/tasks/install.yaml @@ -2,8 +2,8 @@ - name: "enable yum repos" become: yes - command: - yum-config-manager --enable '{{ item }}' + shell: + yum-config-manager --enable '{{ item }}' |grep baseurl loop: '{{ enable_yum_repos }}' diff --git a/roles/tobiko-ensure-python3/vars/RedHat-7.yaml b/roles/tobiko-ensure-python3/vars/RedHat-7.yaml index a130e5a22..a34da9843 100644 --- a/roles/tobiko-ensure-python3/vars/RedHat-7.yaml +++ b/roles/tobiko-ensure-python3/vars/RedHat-7.yaml @@ -1,7 +1,7 @@ --- enable_yum_repos: - - rhel-7-server-optional-rpms + - rhelosp-rhel-*-server-opt python_packages: python3: