Host of a specific group in with_nested

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?

Just saw from the other post that

  • name: Test with nested loops
    debug: msg=“A = {{ item[0] }} / B = {{ item[1] }}”
    with_nested:
  • ${groups.webserver}
  • list_of_items

should be working and in fact it does.

What version of Ansible are you using?

The latest 1.3 from git://github.com/ansible/ansible

Please make sure there is a ticket in github then so we can try to replicate this.

Thanks!

Here is the issue on github: https://github.com/ansible/ansible/issues/3858