Simplify group_by logic by moving conditional to when clause (#12469)

Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>
This commit is contained in:
Ali Afsharzadeh 2025-08-18 18:09:11 +03:30 committed by GitHub
parent fa22f9e5ab
commit 7d3e0d4fe5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,5 +15,6 @@
- kube_control_plane
- calico_rr
group_by:
key: "{{ (group_names | intersect(item.value) | length > 0) | ternary(item.key, '_all') }}"
key: "{{ item.key }}"
when: group_names | intersect(item.value) | length > 0
loop: "{{ group_mappings | dict2items }}"