# Centralizing authentication file for multiple Windows hosts using the same user credentials

**URL:** <https://forum.ansible.com/t/centralizing-authentication-file-for-multiple-windows-hosts-using-the-same-user-credentials/20466>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [February 5, 2016, 5:54pm UTC](https://forum.ansible.com/t/centralizing-authentication-file-for-multiple-windows-hosts-using-the-same-user-credentials/20466 "2016-02-05T17:54:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Levis](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Joe\_Levis](https://forum.ansible.com/u/Joe_Levis)\
**Post date:** [February 5, 2016, 5:54pm UTC](https://forum.ansible.com/t/centralizing-authentication-file-for-multiple-windows-hosts-using-the-same-user-credentials/20466/1 "2016-02-05T17:54:43Z")

</div>

I’m trying to figure out a way to reuse the same auth file for multiple windows hosts. It seems that when you specify a windows host in a playbook, such as [windows-webserver], it automatically looks for a file ‘group\_vars/windows\_webserver.yml’ for credentials. What if I have several hosts that all use the same credentials? Like…

[windows-webserver]  
[windows-backend]  
[windows-database]

It looks like Ansible needs a separate file for each of these with corresponding names under group\_vars in order to authenticate - is this correct? Is there any way to centralize to a single auth file for all Windows hosts if they all have the same credentials?

Much appreciated,  
-Joe

---

<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:** [February 7, 2016, 9:23am UTC](https://forum.ansible.com/t/centralizing-authentication-file-for-multiple-windows-hosts-using-the-same-user-credentials/20466/2 "2016-02-07T09:23:34Z")

</div>

Hey.

Groups can have child groups, so the way I handle it is to have a high level group that just defines connection parameters, and then the more specialised groups such as Web servers or db servers get added as children of the high level group in my inventory .

You can also define group\_vars/all if that makes sense for you.

Inventory looks a bit like this

[windows]

[win\_db]  
Windb1  
Windb2

[win\_web]  
Winweb1  
Winweb2

[windows:children]  
win\_db  
win\_web

Hope this helps

Jon
