Enable minimum CentOS repositories

This is a "backport" from the OSA change introduced in
I2ac5a9c463991e4668a3e7608831c1944377e85e.

The CentOS CI images have many yum repositories enabled by default.
This can cause package conflicts in gate jobs and it doesn't match
what a basic CentOS system would look like for an OpenStack-Ansible
deployer.

This patch disables all repositories for the ansible-role-jobs and
only enables base, epel, and updates. This allows individual roles
to add extra repositories when they need them.

Change-Id: I8fea27726eb674aeb1656f05613b0ebd2cb761bb
Related-Bug: 1708493
This commit is contained in:
David Moreau-Simard 2017-08-04 19:58:34 -04:00
parent dbd72b1a5d
commit db4926f2e2
1 changed files with 12 additions and 5 deletions

View File

@ -64,14 +64,21 @@
template-name: "{template-name}"
- openstack-ansible-tests-checkout
- shell: |
# 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
# NOTE(mhayden): The CentOS CI image has many repositories enabled by
# default that can cause package conflicts. We must disable all of
# them here and only enable base, updates, and epel.
if [[ -e /usr/bin/yum ]] && [[ -x /usr/bin/yum-config-manager ]]; then
sudo yum-config-manager --disable \*
sudo yum-config-manager --enable base
sudo yum-config-manager --enable epel
sudo yum-config-manager --enable updates
fi
- install-distro-packages
- shell: |
if [[ -e /usr/bin/yum ]]; then
# NOTE(mhayden): EPEL is no longer required after installing distro
# packages with bindep. Individual roles may re-enable EPEL if they
# need it for their package installation tasks.
if [[ -e /usr/bin/yum ]] && [[ -x /usr/bin/yum-config-manager ]]; then
sudo yum-config-manager --disable epel
fi
- shell: |