What’s the best way to set up a Windows without any interaction?
With Linux/Unix I’d place my SSH public key onto the installer and be able to connect to the host after first boot.
How can this be done with Windows and WSIM?
Most modern versions of windows have winrm enabled by default so provided you have a suitable user with sufficient privileges, you can often connect once the OS has finished booting up.
That said, there are a lot of factors that need to be considered depending on how things are set up in the environment you are working in.
I recommend reading up on winrm here so you understand the options and can pick most appropriate for your organisation.
Https://docs.ansible.com/ansible/latest/user_guide/windows_winrm.html
I know this sounds like a faff but once you have sorted this stuff out, you probably won't need to touch it again for ages and can get on with getting your playbooks to do what you need.
Cheers,
Jon
I’m sorry I was terribly unclear. I mean, is there a way to connect to Windows with public key authentication (instead of passwords or, beware, X509 crap)? I’d happily use SSH for Windows as well, but according to the docs, that’s not supported. Or will it be a supported way in the future?
Hi Fabiano,
Ansible supports authentication using .pem certificates with WinRM to Windows machines - see https://docs.ansible.com/ansible/devel/user_guide/windows_winrm.html#authentication-options
Is that what you had in mind?
Alicia
Ssh support for Windows was merged a little while back so as long as you are running a recent ansible and can get the ssh server support on to your Windows targets, you can give it a whirl.
https://github.com/ansible/ansible/pull/47732
Hope this helps
Jon