diff --git a/scripts/log-collect.sh b/scripts/log-collect.sh index ca49f7beff..783f94f2e4 100755 --- a/scripts/log-collect.sh +++ b/scripts/log-collect.sh @@ -170,6 +170,10 @@ store_artifacts /openstack/log/ansible-logging/ "${WORKING_DIR}/logs/ansible" store_artifacts /openstack/log/ "${WORKING_DIR}/logs/openstack" store_artifacts /var/log/ "${WORKING_DIR}/logs/host" +# Gather Zuul specific scenario and job variables if they exist +store_artifacts /home/zuul/ "${WORKING_DIR}/zuul-info" "osa-gate-scenario.yml" +store_artifacts /home/zuul/ "${WORKING_DIR}/zuul-info" "osa-job-vars.yml" + # Build the ARA static html report if required if [[ "$ARA_REPORT_TYPE" == "html" ]]; then echo "Generating ARA static html report." diff --git a/tests/roles/bootstrap-host/tasks/gather_nodepool_vars.yml b/tests/roles/bootstrap-host/tasks/gather_runtime_vars.yml similarity index 84% rename from tests/roles/bootstrap-host/tasks/gather_nodepool_vars.yml rename to tests/roles/bootstrap-host/tasks/gather_runtime_vars.yml index 3d3d1a3cad..7092a35f4d 100644 --- a/tests/roles/bootstrap-host/tasks/gather_nodepool_vars.yml +++ b/tests/roles/bootstrap-host/tasks/gather_runtime_vars.yml @@ -34,3 +34,10 @@ - name: Set nodepool environment variables fact ansible.builtin.set_fact: nodepool_vars: "{{ nodepool_env.stdout | from_yaml }}" + +- name: Attempt to load custom var file (if exists) + ansible.builtin.include_vars: "{{ item }}" + with_first_found: + - files: + - "{{ aio_vars_file | default(ansible_facts.env.ZUUL_VARS_FILE) }}" + skip: true diff --git a/tests/roles/bootstrap-host/tasks/main.yml b/tests/roles/bootstrap-host/tasks/main.yml index 7d66d833ef..598d004ce7 100644 --- a/tests/roles/bootstrap-host/tasks/main.yml +++ b/tests/roles/bootstrap-host/tasks/main.yml @@ -43,8 +43,8 @@ tags: - always -- name: Gather nodepool variables - ansible.builtin.import_tasks: gather_nodepool_vars.yml +- name: Gather runtime variables + ansible.builtin.import_tasks: gather_runtime_vars.yml tags: - always diff --git a/zuul.d/playbooks/pre-gate-scenario.yml b/zuul.d/playbooks/pre-gate-scenario.yml index c14bbe91be..61dee41bb9 100644 --- a/zuul.d/playbooks/pre-gate-scenario.yml +++ b/zuul.d/playbooks/pre-gate-scenario.yml @@ -19,7 +19,7 @@ install_methods: - distro - source - zuul_user_vars_file: "{{ ansible_env.HOME }}/osa-job-vars.yml" + zuul_user_vars_file: "{{ ansible_facts.env.HOME }}/osa-job-vars.yml" tasks: - name: Dynamically create scenario if not set ansible.builtin.set_fact: @@ -118,6 +118,7 @@ vars: zuul_helper_var: zuul: "{{ zuul }}" + zuul_vars: "{{ zuul_job_vars | default({}) }}" zuul_site_mirror_info_helper_var: zuul_site_mirror_info: "{{ zuul_site_mirror_info | default({}) }}" ansible.builtin.template: diff --git a/zuul.d/playbooks/pre-osa-aio.yml b/zuul.d/playbooks/pre-osa-aio.yml index 83f843efa8..a1473619b2 100644 --- a/zuul.d/playbooks/pre-osa-aio.yml +++ b/zuul.d/playbooks/pre-osa-aio.yml @@ -57,6 +57,7 @@ # ZUUL_SRC_PATH is used by tests/roles/bootstrap-host # symlink the zuul roles into /openstack/src ZUUL_SRC_PATH: "{{ _zuul_src_path }}" + ZUUL_VARS_FILE: "{{ zuul_user_vars_file }}" SCENARIO: "{{ scenario }}" ACTION: "{{ action }}" INSTALL_METHOD: "{{ install_method }}"