jenkins: jobs: ansible-role-jobs: Always enable the EPEL repo

The ansible-role-jobs are supposed to be used in the OSA repositories so
there is not particular reason to check for the project name before we
enable the EPEL repository. If for whatever reason the EPEL repository
is not there, then we simply return 'true' so we don't break existing
jobs. This fixes a problem with the 'ansible-hardening' repository which
doesn't match the 'openstack-ansible' pattern and as such the EPEL
repository was never enabled for its jobs. This will soon affect the
ansible-hardening jobs with the following error:

2017-07-04 20:45:46.069562 | + sudo PATH=/usr/sbin:/sbin:/usr/local/bin:/usr/bin yum install -y python-ndg_httpsclient
2017-07-04 20:45:46.184220 | Loaded plugins: fastestmirror
2017-07-04 20:45:46.227381 | Loading mirror speeds from cached hostfile
2017-07-04 20:45:46.347841 | No package python-ndg_httpsclient available.
2017-07-04 20:45:46.435958 | Error: Nothing to do
2017-07-04 20:45:46.455212 | + set -e
2017-07-04 20:45:46.456459 | + try=3
2017-07-04 20:45:46.456522 | + /usr/bindep-env/bin/bindep -b -f bindep.txt test
2017-07-04 20:45:47.411528 | python-ndg_httpsclient
2017-07-04 20:45:47.423625 | + '[' 3 -gt 2 ']'
2017-07-04 20:45:47.423690 | + set +x
2017-07-04 20:45:48.408816 |
2017-07-04 20:45:48.408901 | ERROR: These requested packages were not installed:
2017-07-04 20:45:48.408911 |
2017-07-04 20:45:48.408925 | python-ndg_httpsclient
2017-07-04 20:45:48.408931 |
2017-07-04 20:45:48.408940 | + exit 1

Change-Id: If534b74d3e26f8f051e1c6186766d2e6434e21f9
This commit is contained in:
Markos Chandras 2017-06-27 13:20:26 +01:00
parent 16cfb2e687
commit 0fd037862f
1 changed files with 6 additions and 10 deletions

View File

@ -77,19 +77,15 @@
template-name: "{template-name}"
- zuul-git-prep-upper-constraints
- shell: |
if [[ "{name}" == *"openstack-ansible"* ]]; then
# EPEL must be enabled because some deps from bindep.txt are
# otherwise not available
if [[ -e /usr/bin/yum ]]; then
sudo yum-config-manager --enable epel
fi
# EPEL must be enabled because some deps from bindep.txt are
# otherwise not available
if [[ -e /usr/bin/yum ]]; then
sudo yum-config-manager --enable epel
fi
- install-distro-packages
- shell: |
if [[ "{name}" == *"openstack-ansible"* ]]; then
if [[ -e /usr/bin/yum ]]; then
sudo yum-config-manager --disable epel
fi
if [[ -e /usr/bin/yum ]]; then
sudo yum-config-manager --disable epel
fi
- shell: |
# Allow Jenkins user to ssh into localhost