# ansible 1.8 (devel 4c86bd3ca6) not reading group\_vars?

**URL:** <https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [October 21, 2014, 7:56pm UTC](https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573 "2014-10-21T19:56:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob\_Tanner](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Bob\_Tanner](https://forum.ansible.com/u/Bob_Tanner)\
**Post date:** [October 21, 2014, 7:56pm UTC](https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573/1 "2014-10-21T19:56:08Z")

</div>

Following the documentation at [http://docs.ansible.com/intro\_windows.html](http://docs.ansible.com/intro_windows.html).

I setup an inventory file and group windows.  
I setup a group\_vars for for windows.

$ cat customer/windows-testing

[windows]  
[appserv.int.domain.com](http://appserv.int.domain.com)

$ cat group\_vars/windows.yml  
ansible\_ssh\_user: Administrator  
ansible\_ssh\_pass: “Password”  
ansible\_ssh\_port: 5986  
ansible\_connection: winrm

$ whoami  
basictheprogram

$ ansible windows -i customers/windows-testing -m win\_ping -vvvv

\<[appserv.int.domain.com](http://appserv.int.domain.com)\> ESTABLISH CONNECTION FOR USER: basictheprogram on PORT 22 TO [appserv.int.domain.com](http://appserv.int.domain.com)  
[appserv.int.domain.com](http://appserv.int.domain.com) | FAILED =\> FAILED: Authentication failed.

I don’t understand why ansible is attempting to ssh (port 22) as basictheprogram (me) installed of winrm to port 5986 as Administrator.

$ ansible --version  
ansible 1.8 (devel 4c86bd3ca6) last updated 2014/10/21 12:09:14 (GMT -500)  
lib/ansible/modules/core: (detached HEAD cb69744bce) last updated 2014/10/07 14:28:03 (GMT -500)  
lib/ansible/modules/extras: (detached HEAD 8a4f07eecd) last updated 2014/10/07 14:28:06 (GMT -500)  
v2/ansible/modules/core: (detached HEAD cb69744bce) last updated 2014/10/07 14:28:11 (GMT -500)  
v2/ansible/modules/extras: (detached HEAD 8a4f07eecd) last updated 2014/10/07 14:28:15 (GMT -500)  
configured module search path = None

---

<div class="post-metadata">

**Author:** ![Michael\_Wozniak](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@Michael\_Wozniak](https://forum.ansible.com/u/Michael_Wozniak)\
**Post date:** [October 22, 2014, 8:51pm UTC](https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573/2 "2014-10-22T20:51:15Z")

</div>

I think your group\_vars files should not have .yml extensions

---

<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:** [October 22, 2014, 8:55pm UTC](https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573/3 "2014-10-22T20:55:42Z")

</div>

​Given those paths:​

$ customer/windows-testing

> $ group\_vars/windows.yml

​Your group vars (current dir) are one level above your inventory​

​(within customer dir)  
So they are not found..  
​

---

<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:** [October 22, 2014, 8:56pm UTC](https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573/4 "2014-10-22T20:56:48Z")

</div>

​That is not a problem, could even be .yaml or .json​

lib/ansible/constants.py:# check all of these extensions when looking for  
yaml files for things like  
lib/ansible/constants.py:YAML\_FILENAME\_EXTENSIONS = [ "", ".yml", ".yaml",  
".json" ]

---

<div class="post-metadata">

**Author:** ![Michael\_Wozniak](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@Michael\_Wozniak](https://forum.ansible.com/u/Michael_Wozniak)\
**Post date:** [October 22, 2014, 8:58pm UTC](https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573/5 "2014-10-22T20:58:59Z")

</div>

ah, ok. Thanks.

---

<div class="post-metadata">

**Author:** ![Joseph\_Tam](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@Joseph\_Tam](https://forum.ansible.com/u/Joseph_Tam)\
**Post date:** [April 8, 2015, 12:45pm UTC](https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573/6 "2015-04-08T12:45:41Z")

</div>

I just experienced the same issue. ansible doesn’t seem to read group\_vars, but ansible-playbook does. so my group\_vars values are not used.

was this ever solved?

thanks

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [April 8, 2015, 1:04pm UTC](https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573/7 "2015-04-08T13:04:09Z")

</div>

i would find that really strange as they both call the same inventory  
code that is responsible for reading them.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [April 8, 2015, 1:20pm UTC](https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573/8 "2015-04-08T13:20:58Z")

</div>

I guess one difference could be location? group\_vars can also live at the same level as the playbook, as opposed to alongside the inventory.

Without a playbook, I don’t think playbook level group\_vars would be loaded.

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [April 10, 2015, 1:13pm UTC](https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573/9 "2015-04-10T13:13:31Z")

</div>

Looking at some of my group\_vars files, they have the yaml header i.e. they start with

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [April 10, 2015, 1:14pm UTC](https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573/10 "2015-04-10T13:14:40Z")

</div>

Reading that again, it might not be too clear what I mean.

so instead of

$ cat group\_vars/windows.yml  
ansible\_ssh\_user: Administrator  
ansible\_ssh\_pass: “Password”  
ansible\_ssh\_port: 5986  
ansible\_connection: winrm

$ cat group\_vars/windows.yml

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [April 10, 2015, 1:40pm UTC](https://forum.ansible.com/t/ansible-1-8-devel-4c86bd3ca6-not-reading-group-vars/16573/11 "2015-04-10T13:40:09Z")

</div>

It is optional, the header --- and footer .... are needed when you  
want to have more than one yaml document per file.
