Playbook on both Linux and Windows

Hey!

I’m attempting to add a Windows element to one of my Linux playbooks.

They’re both separate roles at the moment. The Linux one has hosts set to localhost, but the Windows part needs to be delegated elsewhere, AND keeping variables from the Linux part.

I’ve attended to add Windows commands with delegate to my Linux playbook, but no dice. I’m getting a port 22 refused. For reference here’s my playbook:

`

How you’re doing it would seem to be the obvious way to me but you’ll need to change the connection first…

"In order to connect to your Windows hosts properly, you need to make sure that you put in ansible_connection=winrm in the host vars section of your inventory file so that Ansible Engine doesn’t just keep trying to connect to your Windows host via SSH. "

https://www.ansible.com/blog/connecting-to-a-windows-host