Files
computer-playbook/tasks/utils/setup/group.yml
kevinveenbirkenbachandClaude Opus 5 8aea5a9b35 fix(deploy): keep role setup in run_after order across hosts
A per-host `when` on the looped include_tasks made ansible insert the included blocks in host order instead of loop order: whichever host reached an item first decided when that item ran. With the nfs-server host last in the inventory, svc-storage-nfs-client mounted the export before svc-storage-nfs-server had deployed it, and the play died on 'mount.nfs4: Connection refused' (run 31645153977, job 94280126636).

Gating on the include_role instead keeps every host on the same loop, so one block per item is inserted in loop order. This is what cli/build/include emitted before 351b64e2c: the when on the include_role, the flush unconditional behind it.

Reproduced with a four-host probe -- server host last inverts the order, gating one level down restores it. In run 31543714113 'setup svc-storage-nfs-server' ran 3 times; in 31645153977 it never ran.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 00:59:53 +02:00

8 lines
254 B
YAML

---
- name: "🧩 setup {{ role_group }} roles in run_after order"
ansible.builtin.include_tasks: ./tasks/utils/setup/role.yml
loop: "{{ lookup('group_roles', role_group) }}"
loop_control:
loop_var: role_entry
label: "{{ role_entry.app }}"