From 5910a88c953bcd3c0253ead172ab760880097557 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Mon, 9 Oct 2023 18:28:44 +0100 Subject: [PATCH] Always use on-disk openstack service git repos in CI jobs This is not dependant on if we are running a regular or an upgrade job. Move the code to a more logical location. Change-Id: Ibdb29a679504ce30bcdc7591b8e68c054dbea580 --- scripts/get-ansible-role-requirements.yml | 7 +------ tests/roles/bootstrap-host/tasks/main.yml | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/get-ansible-role-requirements.yml b/scripts/get-ansible-role-requirements.yml index 01653e2d8f..daf9b23b3b 100644 --- a/scripts/get-ansible-role-requirements.yml +++ b/scripts/get-ansible-role-requirements.yml @@ -97,15 +97,10 @@ path: "{{ config_dir }}" state: directory - - name: Create override for zuul git server to local repos - copy: - content: | - openstack_opendev_base_url: "file:///openstack/src/opendev.org" - dest: "{{ config_dir }}/user_variables_zuulrepos.yml" - when: - "lookup('env', 'ZUUL_SRC_PATH') != ''" - "lookup('env', 'UPGRADE_TARGET_BRANCH') == ''" + - name: Generate a list of user overridden roles set_fact: user_overridden_roles: "{{ user_roles | json_query('[*].name') }}" diff --git a/tests/roles/bootstrap-host/tasks/main.yml b/tests/roles/bootstrap-host/tasks/main.yml index ba5690d5b2..4852d7f32a 100644 --- a/tests/roles/bootstrap-host/tasks/main.yml +++ b/tests/roles/bootstrap-host/tasks/main.yml @@ -71,11 +71,20 @@ # Symlink host repos to /openstack/src to match the lxc continer bind mount # NOTE(jrosser) this must happen *after* prepare_data_disk as /openstack may remounted -- name: Symlink /openstack/src to /home/zuul/src - file: - src: "{{ lookup('env', 'ZUUL_SRC_PATH') }}" - dest: '/openstack/src' - state: link +- name: Use on-disk repos for openstack services in CI + block: + - name: Symlink /openstack/src to /home/zuul/src + file: + src: "{{ lookup('env', 'ZUUL_SRC_PATH') }}" + dest: '/openstack/src' + state: link + + - name: Create override for zuul git server to local repos + copy: + content: | + openstack_opendev_base_url: "file:///openstack/src/opendev.org" + dest: "/etc/openstack_deploy/user_variables_zuulrepos.yml" + when: - "lookup('env', 'ZUUL_SRC_PATH') | length > 0"