# Why does Ansible change to looking for the group name in ssh config if you add a group of groups.

**URL:** <https://forum.ansible.com/t/why-does-ansible-change-to-looking-for-the-group-name-in-ssh-config-if-you-add-a-group-of-groups/16670>\
**Category:** Ansible Project\
**Created:** [November 3, 2014, 4:05pm UTC](https://forum.ansible.com/t/why-does-ansible-change-to-looking-for-the-group-name-in-ssh-config-if-you-add-a-group-of-groups/16670 "2014-11-03T16:05:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ansible1](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@ansible1](https://forum.ansible.com/u/ansible1)\
**Post date:** [November 3, 2014, 4:05pm UTC](https://forum.ansible.com/t/why-does-ansible-change-to-looking-for-the-group-name-in-ssh-config-if-you-add-a-group-of-groups/16670/1 "2014-11-03T16:05:35Z")

</div>

Hi there,

I have a simple inventory file and a ssh config entry for each host.

Inventory file:

```auto
[webservers]
hostname01

[databases]
hostname02

```

ssh config:

```auto
Host hostname01
HostName hostname01.domain.com
IdentityFile hostkey.key

Host hostname02
HostName hostname02.domain.com
IdentityFile hostkey.key

```

This all worked file then I added a group of groups to the inventory and not Ansible is searching for webservers not hostname01 in ssh config. For a single host I can easily modify the Host section of ssh config… but when that group webservers has 10 hosts in it what do I do then?

---

<div class="post-metadata">

**Author:** ![ansible1](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@ansible1](https://forum.ansible.com/u/ansible1)\
**Post date:** [November 3, 2014, 4:07pm UTC](https://forum.ansible.com/t/why-does-ansible-change-to-looking-for-the-group-name-in-ssh-config-if-you-add-a-group-of-groups/16670/2 "2014-11-03T16:07:08Z")

</div>

To clarify my inventory file now looks like this:

[webservers]  
hostname01

[databases]  
hostname02

[production]  
webservers  
databases

---

<div class="post-metadata">

**Author:** ![Michael\_Peters](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@Michael\_Peters](https://forum.ansible.com/u/Michael_Peters)\
**Post date:** [November 3, 2014, 4:11pm UTC](https://forum.ansible.com/t/why-does-ansible-change-to-looking-for-the-group-name-in-ssh-config-if-you-add-a-group-of-groups/16670/3 "2014-11-03T16:11:37Z")

</div>

The children of a group in the inventory are assumed to be hostnames,  
not other groups. This is why ssh is trying to find that groupname in  
the ssh config, because it's supposed to be a host.

If you want to put a group as a child of another group you need to use  
this syntax:

[productiont:children]  
webservers  
databases

See [http://docs.ansible.com/intro\_inventory.html](http://docs.ansible.com/intro_inventory.html)

---

<div class="post-metadata">

**Author:** ![ansible1](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@ansible1](https://forum.ansible.com/u/ansible1)\
**Post date:** [November 3, 2014, 4:30pm UTC](https://forum.ansible.com/t/why-does-ansible-change-to-looking-for-the-group-name-in-ssh-config-if-you-add-a-group-of-groups/16670/4 "2014-11-03T16:30:40Z")

</div>

🙂 All sorted.

Thanks you.
