diff --git a/scripts/get-ansible-role-requirements.yml b/scripts/get-ansible-role-requirements.yml index ee2909a038..1d2e3bda70 100644 --- a/scripts/get-ansible-role-requirements.yml +++ b/scripts/get-ansible-role-requirements.yml @@ -36,16 +36,22 @@ - name: Use Zuul provided sources in Zuul environment block: + - name: Set Zuul sources path + set_fact: + zuul_src_path: "{{ lookup('env', 'ZUUL_SRC_PATH') }}" - name: Check the Zuul src dir for cloned roles stat: - path: "/home/zuul/src/{{ item.src.split('/')[-3:] | join('/') }}" + path: "{{ zuul_src_path }}/{{ item.src.split('/')[-3:] | join('/') }}" + get_attributes: no + get_checksum: no + get_mime: no register: zuul_roles when: - item.scm == "git" or item.scm is undefined with_items: "{{ required_roles }}" - name: Link the Zuul provided roles file: - src: "/home/zuul/src/{{ item.item.src.split('/')[-3:] | join('/') }}" + src: "{{ zuul_src_path }}/{{ item.item.src.split('/')[-3:] | join('/') }}" dest: "{{ item.item.path | default(role_path_default) }}/{{ item.item.name | default(item.item.src | basename) }}" state: link owner: root @@ -54,7 +60,7 @@ | selectattr('stat.exists') | list }}" when: - - "lookup('env', 'ZUUL_PROJECT') != ''" + - "lookup('env', 'ZUUL_SRC_PATH') != ''" - name: Clone git repos (with git) git: diff --git a/zuul.d/playbooks/run.yml b/zuul.d/playbooks/run.yml index 169f83f8f4..2a69cdc6db 100644 --- a/zuul.d/playbooks/run.yml +++ b/zuul.d/playbooks/run.yml @@ -1,5 +1,9 @@ - hosts: all tasks: + - name: Set the Zuul sources path + set_fact: + zuul_src_path: "{{ ansible_user_dir }}/src" + - name: Set current test repo (cross-repo) set_fact: current_test_repo: "git.openstack.org/{{ osa_test_repo }}" @@ -19,7 +23,7 @@ args: chdir: "src/{{ current_test_repo }}" environment: - # ZUUL_PROJECT is used by tests/get-ansible-role-requirements to - # determine when CI provided repos should be used. - ZUUL_PROJECT: "{{ zuul.project.short_name }}" + # ZUUL_SRC_PATH is used by tests/get-ansible-role-requirements to + # where the CI provided git sources were cloned. + ZUUL_SRC_PATH: "{{ zuul_src_path }}" ANSIBLE_PACKAGE: "{{ ansible_package | default('') }}"