From d5cda7aacc3e2075fc5401248dbafda19333cad8 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Fri, 1 Dec 2017 13:03:20 +0000 Subject: [PATCH] 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 --- common-tasks/test-set-nodepool-vars.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/common-tasks/test-set-nodepool-vars.yml b/common-tasks/test-set-nodepool-vars.yml index 3a0e163b..87726d25 100644 --- a/common-tasks/test-set-nodepool-vars.yml +++ b/common-tasks/test-set-nodepool-vars.yml @@ -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: