When providing two simple lists in with_nested, it works just as expected:
- name: Test with nested loops
debug: msg=“A = {{ item[0] }} / B = {{ item[1] }}”
with_nested: - [‘test’, ‘y’]
- list_of_items
I’d like to provide the list of hosts as one of the parameters, e.g.
- name: Test with nested loops
debug: msg=“A = {{ item[0] }} / B = {{ item[1] }}”
with_nested: - groups[‘webserver’]
- list_of_items
But the second one doesn’t work, I always get an error saying “Can’t resolve groups[‘webserver’]” although that group of hosts is defined in my inventory.
What am I doing wrong?