# Windows and Groups

**URL:** <https://forum.ansible.com/t/windows-and-groups/22251>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [August 9, 2016, 9:05pm UTC](https://forum.ansible.com/t/windows-and-groups/22251 "2016-08-09T21:05:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Fisher](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@Allen\_Fisher](https://forum.ansible.com/u/Allen_Fisher)\
**Post date:** [August 9, 2016, 9:05pm UTC](https://forum.ansible.com/t/windows-and-groups/22251/1 "2016-08-09T21:05:25Z")

</div>

Hello–

Fairly new to Ansible and am starting to really dig into what I can do with it. I got my first server up and going using [http://docs.ansible.com/ansible/intro\_windows.html](http://docs.ansible.com/ansible/intro_windows.html), but am concerned that I only seem to be able to connect to a system via WinRM if it is a member of an inventory group called windows. Is there a way I can have two host groups, say, [clients] and [servers] that I could sort my windows hosts into and manage them differently? I read some documentation on [Inventory](http://docs.ansible.com/ansible/intro_inventory.html#non-ssh-connection-types) and it mentioned connection types, but windows is not listed as a connection type.

Thanks for any help anyone can provide

Allen

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [August 10, 2016, 12:27am UTC](https://forum.ansible.com/t/windows-and-groups/22251/2 "2016-08-10T00:27:06Z")

</div>

Hi Allen,  
Windows is only meant as an example of a group. Nothing is stopping you from organizing your inventory like this, for example:  
[clients]  
client1

[servers]  
server1

However, since Windows nodes require a winrm connection, you need to specify that for all windows nodes so that Ansible is aware of the fact that the node is running windows. You can do this in several ways:  
option 1, continuing from the example above:

[clients]  
client1

[servers]  
server1

[clients:vars]  
ansible\_connection=winrm

[servers:vars]  
ansible\_connection=winrm

A more flexible approach is to have a “top-level” group where the common vars are stored, and then have your two groups “inherit” from that:

[windows]  
[windows:children]  
clients  
servers

[clients]  
client1

[servers]  
server1

[windows:vars]  
ansible\_connection=winrm

again, the group name “windows” is just an example, it can be anything you like.

---

<div class="post-metadata">

**Author:** ![Allen\_Fisher](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@Allen\_Fisher](https://forum.ansible.com/u/Allen_Fisher)\
**Post date:** [August 10, 2016, 6:59pm UTC](https://forum.ansible.com/t/windows-and-groups/22251/3 "2016-08-10T18:59:35Z")

</div>

Hi Trond–

Thanks for the response. I was trying to figure out sub-groups yesterday thinking that may be the way to go.

Allen
