test-set-nodepool-vars: Add nodepool mirror discovery for openSUSE

openSUSE mirros are now configurable in the
openstack-ansible-openstack-hosts role so we need to make sure we are
using the internal OpenStack ones when running in zuul. This patch also
modifies the code to check for /etc/nodepool instead of
/etc/nodepool/provider because the latter doesn't seem to exist anymore.

Change-Id: I6df997e13f678faaddac8b5d1818f2906bac08ec
This commit is contained in:
Markos Chandras 2017-12-01 13:03:20 +00:00
parent 0ab3aaeee9
commit d5cda7aacc
1 changed files with 24 additions and 1 deletions

View File

@ -15,7 +15,7 @@
- name: Check if this is an OpenStack-CI nodepool instance
stat:
path: /etc/nodepool/provider
path: /etc/nodepool
register: nodepool
delegate_to: localhost
@ -81,6 +81,29 @@
- ansible_pkg_mgr in ['yum', 'dnf']
- nodepool.stat.exists | bool
- name: Discover the openSUSE mirror URL when in nodepool
shell: |
source /etc/ci/mirror_info.sh
echo "${NODEPOOL_OPENSUSE_MIRROR}"
args:
executable: /bin/bash
register: opensuse_mirror
delegate_to: localhost
when:
- ansible_pkg_mgr == 'zypper'
- nodepool.stat.exists | bool
tags:
- skip_ansible_lint
- name: Set a fact to override the openSUSE mirror URL when in nodepool
set_fact:
opensuse_mirror: "{{ opensuse_mirror.stdout }}"
# OpenStack infra doesn't mirror OBS repos so use the upstream one
opensuse_mirror_obs: "http://download.opensuse.org"
when:
- ansible_pkg_mgr == 'zypper'
- nodepool.stat.exists | bool
- name: Set the files to copy into the container cache for OpenStack-CI instances
set_fact:
lxc_container_cache_files: