# Ansible also trying to reach the groupname as a host

**URL:** <https://forum.ansible.com/t/ansible-also-trying-to-reach-the-groupname-as-a-host/12066>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [November 3, 2012, 12:45pm UTC](https://forum.ansible.com/t/ansible-also-trying-to-reach-the-groupname-as-a-host/12066 "2012-11-03T12:45:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [November 3, 2012, 12:45pm UTC](https://forum.ansible.com/t/ansible-also-trying-to-reach-the-groupname-as-a-host/12066/1 "2012-11-03T12:45:14Z")

</div>

This has never happened to me, is this all you have in your inventory file?

I am not sure I understand the second question...

---

<div class="post-metadata">

**Author:** ![Mark\_Maas](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Mark\_Maas](https://forum.ansible.com/u/Mark_Maas)\
**Post date:** [November 6, 2012, 7:03am UTC](https://forum.ansible.com/t/ansible-also-trying-to-reach-the-groupname-as-a-host/12066/2 "2012-11-06T07:03:55Z")

</div>

> This has never happened to me, is this all you have in your inventory file?

I don’t really know what happened, but I think I got the names of my groups mixed up. I’ve since cleaned up my /etc/ansible/hosts file a bit and it has not happened anymore.

> I am not sure I understand the second question…

Well consider this:

cat /etc/ansible/hosts

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [November 6, 2012, 7:13am UTC](https://forum.ansible.com/t/ansible-also-trying-to-reach-the-groupname-as-a-host/12066/3 "2012-11-06T07:13:57Z")

</div>

Make that

[world:children]  
north  
south

and use ‘world’ as the groupname.

Serge

---

<div class="post-metadata">

**Author:** ![Mark\_Maas](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Mark\_Maas](https://forum.ansible.com/u/Mark_Maas)\
**Post date:** [November 6, 2012, 7:40am UTC](https://forum.ansible.com/t/ansible-also-trying-to-reach-the-groupname-as-a-host/12066/4 "2012-11-06T07:40:15Z")

</div>

Ah, so the keyword “:children” tells ansible that this is a group made out of groups? (Which also explains why ansible would also start trying “north” and “south” as if they where hostnames…)

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [November 6, 2012, 8:21am UTC](https://forum.ansible.com/t/ansible-also-trying-to-reach-the-groupname-as-a-host/12066/5 "2012-11-06T08:21:30Z")

</div>

Yes, that’s correct. You can also nest this and make groups of groups of groups, etc.

Serge

---

<div class="post-metadata">

**Author:** ![Mark\_Maas](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Mark\_Maas](https://forum.ansible.com/u/Mark_Maas)\
**Post date:** [November 7, 2012, 1:55pm UTC](https://forum.ansible.com/t/ansible-also-trying-to-reach-the-groupname-as-a-host/12066/6 "2012-11-07T13:55:18Z")

</div>

Excellent, thanks!
