SET_STATS NOT WORKING

Hey everyone!

I’m currently running a brand new AWX installation. Everything is working fine, and I thought of giving workflows a chance. Everything is working as expected, but the set_stats command is not generating a variable that can be consumend by another step of the workflow.

This is how I’m using it:

- name: Sanitize deployment version
ansible.builtin.set_stats:
data:
sanitized_version: “{{ version | regex_replace(‘[^-_0-9a-zA-Z]’, ‘-’)}}”

In the second playbook, I try doing:

- name: Add number to version
set_fact:
numbered_version: “{{ sanitized_version }}-1”

That’s not working. The playbook complains about sanitized_version not being defined.

What I’m doing wrong? Is there a special configuration for the jobs templates that I need? Any special configuration for the workflow?

I’d really appreaciate the help, as if we can’t make this happen, I don’t see the point in using workflows :S

F.

Hi!

After running the workflow, you should be able to go to the details page of the first job that runs in the workflow, and see that “sanitized_version” is listed in the “Artifacts” box. Likewise, you should be able to see “sanitized_version” listed in the “Variables” box in the detail page of the second job.

set_stats behavior gets tricky for some types of workflow configurations, do you mind sharing what your workflow structure looked like while testing this? e.g. Job1 → Job2

Seth