AWX Workflow Convergence Artifacts

I have the following problem: In my current workflow I have 2 long running playbooks, which run in parallel. If they both succeed, a follow up playbook starts, which requires data from both previous playbooks

Here an example:

image

To reduce code complexity they both write to a “customer” object, albeit to different children:

First playbook

customer:
  1234:
    color: yellow

Second playbook

customer:
  1234:
    foo: bar

In my mind, AWX would combine these into a struct such as this:

customer:
  1234:
    foo: bar
    color: yellow

But instead it only gets the data from the playbook that finishes first. How can I change that, or is there anything at all I can do about that?

I was thinking about packing it all into a workflow tempalte and using that workflow tempalte itself in another workflow template. But would that even work?

Hi.
This is expected behavior in Ansible, as variables will override each other according to this variable precedence.

One solution is to separate the customer variables in first and second playbook, and then combine the result in the third playbook.

---
- name: Play1.
  hosts: localhost
  tasks:
    - name: Set customer fact.
      ansible.builtin.set_fact:
        customer_1:
          1234:
            foo: bar

- name: Play2.
  hosts: localhost
  tasks:
    - name: Set customer fact.
      ansible.builtin.set_fact:
        customer_2:
          1234:
            color: yellow

- name: Play3.
  hosts: localhost
  tasks:
    - name: Combine facts.
      ansible.builtin.set_fact:
        customer: "{{ customer_1 | ansible.builtin.combine(customer_2, recursive=true) }}"

    - name: Print combined customer fact.
      ansible.builtin.debug:
        var: customer