From 3500a26919b5f420c15b80323fff7928e05054b9 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Mon, 21 Aug 2017 07:35:28 -0500 Subject: [PATCH] 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 --- defaults/main.yml | 4 ++++ ...os-mirror-url-variable-eea9f226b5611b40.yaml | 5 +++++ tasks/pre_install_yum.yml | 17 +++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 releasenotes/notes/centos-mirror-url-variable-eea9f226b5611b40.yaml diff --git a/defaults/main.yml b/defaults/main.yml index ec22c24..ae42a51 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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' diff --git a/releasenotes/notes/centos-mirror-url-variable-eea9f226b5611b40.yaml b/releasenotes/notes/centos-mirror-url-variable-eea9f226b5611b40.yaml new file mode 100644 index 0000000..73eb932 --- /dev/null +++ b/releasenotes/notes/centos-mirror-url-variable-eea9f226b5611b40.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Deployers can set ``pip_install_centos_mirror_url`` to use their + preferred mirror for the RDO repositories. diff --git a/tasks/pre_install_yum.yml b/tasks/pre_install_yum.yml index 0fdfcce..a4fad1b 100644 --- a/tasks/pre_install_yum.yml +++ b/tasks/pre_install_yum.yml @@ -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 }}"