How do you search for substring in ansible group_names?
You can select and count items with filters:
when: group_names | select('search','hello') | list | count > 0
You can select and count items with filters:
when: group_names | select('search','hello') | list | count > 0