From 45ec917d1d9d8f256c3aa3c1805d842fb9247bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Wed, 20 Jun 2018 13:45:42 +0200 Subject: [PATCH] Do not fail when repoquery is not installed A good chunk of container images try to be as slim as possible and as a consequence do not have repoquery binary which is used to limit the packages to a given repo. This commit makes the playbook more against these containers and installs all available updates when repoquery is not installed, the same as when we don't restrict the list of repositories to get updates from. Change-Id: I81e5cd0edae56c1535a2e4dcc639ec71055b10d2 --- files/yum_update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/yum_update.sh b/files/yum_update.sh index fc045cc..815ffe2 100755 --- a/files/yum_update.sh +++ b/files/yum_update.sh @@ -10,7 +10,7 @@ if [ -f /tmp/host_packages.json ]; then fi packages_for_update= -if [ -n "$1" ]; then +if [ -n "$1" ] && command -v repoquery >/dev/null 2>&1; then packages_for_update=("$(repoquery --disablerepo='*' --enablerepo=$1 --qf %{NAME} -a)") fi