summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-06-29 09:46:53 -0400
committerScott Dodson <sdodson@redhat.com>2016-06-29 09:51:54 -0400
commitc64bd9065511bc6cb508750d167ab9d8a03b182f (patch)
tree4dbd0d39ba98d533b6d61c0e23af37d3b6332536
parentbf520e46e6916a4c9995ea95fa40cdd25f31209e (diff)
downloadopenshift-c64bd9065511bc6cb508750d167ab9d8a03b182f.tar.gz
openshift-c64bd9065511bc6cb508750d167ab9d8a03b182f.tar.bz2
openshift-c64bd9065511bc6cb508750d167ab9d8a03b182f.tar.xz
openshift-c64bd9065511bc6cb508750d167ab9d8a03b182f.zip
Switch to repoquery, enable plugins for satellite support
-rw-r--r--playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh10
-rw-r--r--roles/docker/vars/main.yml1
-rw-r--r--roles/openshift_docker_facts/vars/main.yml2
3 files changed, 8 insertions, 5 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh b/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh
index a2a9579b5..8d7543f3c 100644
--- a/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh
+++ b/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh
@@ -1,7 +1,11 @@
#!/bin/bash
-
-installed=$(yum list installed -e 0 -q "$@" 2>&1 | tail -n +2 | awk '{ print $2 }' | sort -r | tr '\n' ' ')
-available=$(yum list available -e 0 -q "$@" 2>&1 | tail -n +2 | grep -v 'el7ose' | awk '{ print $2 }' | sort -r | tr '\n' ' ')
+if [ `which dnf 2> /dev/null` ]; then
+ installed=$(dnf repoquery --installed --latest-limit 1 -d 0 --qf '%{version}-%{release}' "${@}" 2> /dev/null)
+ installed=$(dnf repoquery --available --latest-limit 1 -d 0 --qf '%{version}-%{release}' "${@}" 2> /dev/null)
+else
+ installed=$(repoquery --plugins --pkgnarrow=installed --qf '%{version}-%{release}' "${@}" 2> /dev/null)
+ available=$(repoquery --plugins --pkgnarrow=available --qf '%{version}-%{release}' "${@}" 2> /dev/null)
+fi
echo "---"
echo "curr_version: ${installed}"
diff --git a/roles/docker/vars/main.yml b/roles/docker/vars/main.yml
index 606cdb9b9..f81f99e2b 100644
--- a/roles/docker/vars/main.yml
+++ b/roles/docker/vars/main.yml
@@ -1,3 +1,2 @@
---
-repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery' }}"
udevw_udevd_dir: /etc/systemd/system/systemd-udevd.service.d
diff --git a/roles/openshift_docker_facts/vars/main.yml b/roles/openshift_docker_facts/vars/main.yml
index f7ad1b329..55c04b0c1 100644
--- a/roles/openshift_docker_facts/vars/main.yml
+++ b/roles/openshift_docker_facts/vars/main.yml
@@ -1,2 +1,2 @@
---
-repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery' }}"
+repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery --plugins' }}"