Allow override of RDO repo baseurl

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

Change-Id: I81d89299541211556bd76794a82475f3879fa297
This commit is contained in:
Major Hayden 2017-08-18 10:06:24 -05:00
parent 0e3a6faa13
commit 690ecb8ca4
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1
3 changed files with 27 additions and 0 deletions

View File

@ -103,3 +103,7 @@ openstack_domain: openstack.local
# Global environment variables should be empty by default
global_environment_variables: {}
# Set default mirror for CentOS repositories
# NOTE(mhayden): Ensure that the full path to the 'centos' directory is used.
#openstack_hosts_centos_mirror_url: 'http://mirror.centos.org/centos'

View File

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

View File

@ -34,6 +34,24 @@
- openstack-yum-packages
- openstack-packages
- 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: "{{ openstack_hosts_centos_mirror_url }}/7/virt/$basearch/kvm-common/"
- repo_name: openstack-ocata
baseurl: "{{ openstack_hosts_centos_mirror_url }}/7/cloud/$basearch/openstack-ocata/"
when:
- user_external_repo_key is not defined
- openstack_hosts_centos_mirror_url is defined
tags:
- add-repo-keys
- name: Install EPEL, and yum priorities plugin
package:
name: "{{ item }}"