Allow override of RDO repo baseurl

This patch allows deployers to set pip_install_centos_mirror_url
and override the default RDO repository (mirrors.centos.org).

Change-Id: I7b0dd5d14c82a74be955071e638c122ffb45ab31
This commit is contained in:
Major Hayden 2017-08-21 07:35:28 -05:00
parent 89e19de7b6
commit 3500a26919
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1
3 changed files with 26 additions and 0 deletions

View File

@ -127,3 +127,7 @@ pip_install_options: ""
# Always force getting the latest get-pip script
pip_get_pip_force: yes
# Set default mirror for CentOS repositories
# NOTE(mhayden): Ensure that the full path to the 'centos' directory is used.
#pip_install_centos_mirror_url: 'http://mirror.centos.org/centos'

View File

@ -0,0 +1,5 @@
---
features:
- |
Deployers can set ``pip_install_centos_mirror_url`` to use their
preferred mirror for the RDO repositories.

View File

@ -28,6 +28,23 @@
tags:
- add-repo-keys
- name: Ensure RDO repositories are using the correct CentOS mirror
command: |
yum-config-manager
--save
--setopt="{{ item.repo_name }}.baseurl={{ item.baseurl }}"
changed_when: false
with_items:
- repo_name: rdo-qemu-ev
baseurl: "{{ pip_install_centos_mirror_url }}/7/virt/$basearch/kvm-common/"
- repo_name: openstack-ocata
baseurl: "{{ pip_install_centos_mirror_url }}/7/cloud/$basearch/openstack-ocata/"
when:
- user_external_repo_key is not defined
- pip_install_centos_mirror_url is defined
tags:
- add-repo-keys
- name: Install EPEL and yum priorities plugin
package:
name: "{{ pip_epel_prep_distro_packages }}"