Using ansible on Windows through ssh

I’ve noticed some posts from a year ago (here, and here) about using OpenSSH on windows and avoiding WinRM. Are there any updates to this? Has this been implemented yet?

It’s still an ongoing plan but nothing concrete has come out of it yet. TBH the only benefits I see with SSH over WInRM is;

  • Faster file transfers
  • Simpler authentication with private keys
    The Win32-OpenSSH port is still a bit buggy so I wouldn’t trust it in an environment setup right now.

Thanks

Jordan

Thanks for the update.

I was hoping it would make using ansible with windows as simple or at least similar to using ansible with Linux. I think that would be a huge improvement (instead of needing to learn two ways of doing things).

What I’m most concerned with is the WinRM issues such as running in an interactive session. Currently I do the task scheduling hack to do that, but asynchronous operations like this are hard to follow and debug. Would that help at all?

You should look at using become https://docs.ansible.com/ansible/latest/user_guide/become.html#become-and-windows. What become does on Windows is to change the logon type from a network to an interactive logon. This allows you to bypass certain limitations you have with WinRM and run things like you would locally. This is a lot simpler than using scheduled tasks and can be used with any module except the raw (script was only recently added in devel).

SSH would still have the same limitations as WinRM when it comes to network logons but become should also do the same thing there.

Thanks

Jordan