Discover CentOS mirror in nodepool jobs

This patch discovers the CentOS mirror in the nodepool jobs and sets
a variable to be used by the pip_install role later. This will allow
the pip_install role to adjust the yum repo configuration to use the
best CentOS mirror.

Change-Id: I382b8ef06f5c99de7fa1ce5895bd229867c12535
This commit is contained in:
Major Hayden 2017-08-10 15:53:58 -05:00
parent 72b42af30a
commit afb957d0bc
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1
1 changed files with 22 additions and 0 deletions

View File

@ -59,6 +59,28 @@
- ansible_pkg_mgr == 'apt'
- nodepool.stat.exists | bool
- name: Discover the CentOS mirror URL when in nodepool
shell: |
source /etc/ci/mirror_info.sh
echo "${NODEPOOL_CENTOS_MIRROR}"
args:
executable: /bin/bash
register: centos_mirror_url
delegate_to: localhost
when:
- ansible_pkg_mgr in ['yum', 'dnf']
- nodepool.stat.exists | bool
tags:
- skip_ansible_lint
# NOTE(mhayden): This mirror URL already has the '/centos' URI added.
- name: Set a fact to override the CentOS mirror URL when in nodepool
set_fact:
pip_install_centos_mirror_url: "{{ centos_mirror_url.stdout }}"
when:
- ansible_pkg_mgr in ['yum', 'dnf']
- nodepool.stat.exists | bool
# NOTE(mhayden): GPG checking for local package installs is normally disabled
# by default in CentOS, but the ansible-hardening role enables GPG
# checking for local packages. The RDO repository package isn't signed, but the