Specifying WIndows systems in a mixed host environment

Hello All:
Please help!

Problem -

I have a hosts file separated out with different branches of an organization as such:

[branch01]
server01
server02
server03
[branch02]
server04
server05
…etc

The problem is that if server01 and server05 are windows, how do I specify to use WinRM?

I’ve tried the following:

Easiest way is to create a Windows group, define the connection plugin in that group, and finally add your Windows hosts as children of that group;

`
[windows:children]
server01
server03
branch02

[windows:vars]
ansible_connection=winrm

`

You can add some more values to configure WinRM if you wish but by default you at least need to tell Ansible to use the winrm connection plugin.

Okay, thanks. I was trying to ensure against putting the host name twice to ensure against confusion. I guess I will separate the branches futher by [branch01_linux] and [branch01_windows]…ect. Thanks for the clarification. I just wish I could use logic (‘if unable to connect ssh then try winrm’) against my hosts