# localhost in multiple groups (e.g. all) as well as "ungrouped"

**URL:** <https://forum.ansible.com/t/localhost-in-multiple-groups-e-g-all-as-well-as-ungrouped/22346>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [August 22, 2016, 3:38pm UTC](https://forum.ansible.com/t/localhost-in-multiple-groups-e-g-all-as-well-as-ungrouped/22346 "2016-08-22T15:38:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Resnick](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@David\_Resnick](https://forum.ansible.com/u/David_Resnick)\
**Post date:** [August 22, 2016, 3:38pm UTC](https://forum.ansible.com/t/localhost-in-multiple-groups-e-g-all-as-well-as-ungrouped/22346/1 "2016-08-22T15:38:24Z")

</div>

I’ve found a regression in Ansible 2.1.1.0 where group\_vars are not being applied correctly to a host that is shown as part of those groups.

My playbook is for performing AWS operations.

My inventory file looks something like this:

[control\_host]  
localhost connection=local  
[nonprod]  
[eu-nonprod]  
[eu-west-1]  
[demo]  
[eu-west-1:children]

control\_host  
[demo:children]

control\_host  
[nonprod:children]

eu-nonprod  
demo  
[eu-nonprod:children]

eu-west-1

When I run this with Ansible 2.1.1 my groups\_vars are not picked up – including values set in group\_vars/all.yml. With 2.1.0 group\_vars are set as expected.

I’m not sure this is connected, but I’ve noticed that localhost is shown as belonging to all expected groups when running with 2.1.0 – and with Ansible 2.1.1 localhost is shown to belong to the “ungrouped” group as well.

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> {  
“groups”: {  
“all”: [  
“localhost”  
],  
“control\_host”: [  
“localhost”  
],  
“demo”: [  
“localhost”  
],  
“eu-nonprod”: [  
“localhost”  
],  
“eu-west-1”: [  
“localhost”  
],  
“nonprod”: [  
“localhost”  
],  
“ungrouped”: [  
“localhost”  
]  
}  
}

Am I missing something here? Should I open an issue about this?

Thanks,  
David
