Browse Source

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

Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>
pull/12279/merge
Ali Afsharzadeh 1 month ago
committed by GitHub
parent
commit
7d3e0d4fe5
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions
  1. 3
      roles/dynamic_groups/tasks/main.yml

3
roles/dynamic_groups/tasks/main.yml

@ -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 }}"
Loading…
Cancel
Save