# Host of a specific group in with\_nested

**URL:** <https://forum.ansible.com/t/host-of-a-specific-group-in-with-nested/13289>\
**Category:** Ansible Project\
**Created:** [August 13, 2013, 4:43pm UTC](https://forum.ansible.com/t/host-of-a-specific-group-in-with-nested/13289 "2013-08-13T16:43:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jurgen\_Haas2](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Jurgen\_Haas2](https://forum.ansible.com/u/Jurgen_Haas2)\
**Post date:** [August 13, 2013, 4:43pm UTC](https://forum.ansible.com/t/host-of-a-specific-group-in-with-nested/13289/1 "2013-08-13T16:43:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Jurgen\_Haas2](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Jurgen\_Haas2](https://forum.ansible.com/u/Jurgen_Haas2)\
**Post date:** [August 13, 2013, 4:48pm UTC](https://forum.ansible.com/t/host-of-a-specific-group-in-with-nested/13289/2 "2013-08-13T16:48:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [August 13, 2013, 8:27pm UTC](https://forum.ansible.com/t/host-of-a-specific-group-in-with-nested/13289/3 "2013-08-13T20:27:39Z")

</div>

What version of Ansible are you using?

---

<div class="post-metadata">

**Author:** ![Jurgen\_Haas2](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Jurgen\_Haas2](https://forum.ansible.com/u/Jurgen_Haas2)\
**Post date:** [August 15, 2013, 7:04am UTC](https://forum.ansible.com/t/host-of-a-specific-group-in-with-nested/13289/4 "2013-08-15T07:04:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [August 15, 2013, 12:32pm UTC](https://forum.ansible.com/t/host-of-a-specific-group-in-with-nested/13289/5 "2013-08-15T12:32:59Z")

</div>

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

Thanks!

---

<div class="post-metadata">

**Author:** ![Jurgen\_Haas2](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Jurgen\_Haas2](https://forum.ansible.com/u/Jurgen_Haas2)\
**Post date:** [August 15, 2013, 3:02pm UTC](https://forum.ansible.com/t/host-of-a-specific-group-in-with-nested/13289/6 "2013-08-15T15:02:13Z")

</div>

Here is the issue on github: [https://github.com/ansible/ansible/issues/3858](https://github.com/ansible/ansible/issues/3858)
