Zuul-ci zuul pass a variable to dependent job

681 Views Asked by At

I have a question regarding zuul_return option mentioned in the documentation https://zuul-ci.org/docs/zuul/reference/jobs.html#return-values How I can catch/reference the returned variable in the dependent job. So for example I have one job let's call it build-smth that runs playbook foo-bar.yaml that has only this task

tasks:
  - zuul_return:
      data:
        foo: bar

Next I have a job post-foo that depends on build-smth And I would like to catch this returned data from build-smth in the post-foo job that runs playbook bar-foo.yaml and use it within this playbook?, Because to be honest I don't know if understand this correctly from the documentation but I should be able to pass one variable from one job to the other that is dependent on the privious job. Thanks any help would be highly appreciated

1

There are 1 best solutions below

0
On

The variable is present in the dependent job as a regular ansible variable:

tasks:
  - debug:
      msg: "{{ foo }}"