Fix conditional for EPEL Repo enable/disable for OSA
Because the job runs against Ubuntu and CentOS7 hosts, we need to ensure
that the task won't fail on an Ubuntu host. This patch changes to a
conditional so the exit code is 0 rather than 1 when running on Ubuntu.
if [[ "{name}" == *"openstack-ansible"* ]]; then
# EPEL must be enabled because some deps from bindep.txt are
# otherwise not available
- [[ -e /usr/bin/yum ]] && sudo yum-config-manager --enable epel
+ if [[ -e /usr/bin/yum ]]; then
+ sudo yum-config-manager --enable epel
+ fi
fi
- install-distro-packages
- shell: |
if [[ "{name}" == *"openstack-ansible"* ]]; then
- [[ -e /usr/bin/yum ]] && sudo yum-config-manager --disable epel
+ if [[ -e /usr/bin/yum ]]; then
+ sudo yum-config-manager --disable epel
+ fi
fi
- shell: |
# Allow Jenkins user to ssh into localhost
