Merge "Create yaml file of the zuul job vars for embedded ansible"

This commit is contained in:
Zuul 2022-03-21 15:53:28 +00:00 committed by Gerrit Code Review
commit 8c7b7f6035
3 changed files with 15 additions and 1 deletions

View File

@ -23,6 +23,7 @@
install_methods:
- distro
- source
zuul_user_vars_file: "{{ ansible_env.HOME }}/osa-job-vars.yml"
tasks:
- name: Dynamically create scenario if not set
set_fact:
@ -110,3 +111,13 @@
src: osa-gate-scenario.yml.j2
dest: "{{ zuul.executor.work_root }}/osa-gate-scenario.yml"
delegate_to: localhost
# Other playbooks can consume this vars file to access the
# Zuul job variables, see https://zuul-ci.org/docs/zuul/reference/jobs.html#user-jobs-job-variables
- name: Record the zuul user job variables for future use by embedded ansible
vars:
zuul_helper_var:
zuul: "{{ zuul }}"
template:
src: osa-job-vars.yml.j2
dest: "{{ zuul_user_vars_file }}"

View File

@ -2,4 +2,5 @@
scenario: {{ scenario | to_json }}
action: {{ action | to_json }}
install_method: {{ install_method | to_json }}
install_method: {{ install_method | to_json }}
zuul_user_vars_file: {{ zuul_user_vars_file }}

View File

@ -0,0 +1,2 @@
---
{{ zuul_helper_var | to_nice_yaml(indent=2) }}