Ansible support for Windows Server 2016

Hi,

I am a bit of a newbie to Ansible. Not much of a windows user either to be honest :slight_smile:

But we may be looking at a project to spin up a windows server and deploy a .NET application on it. The wanted tools for this is Vagrant and Ansible.

Been doing a bit of research and can’t quite determine the best stack for this.

From what I have read Ansible 1.7 and higher is supported on Windows 10 and Windows Server 2012 R2 through the use of power shell remoting.

I also read that Windows Subsystem for Linux (WSL) bash is supported on Windows 10. If at all possible we would like to use WSL, as we are already very linux based.

What I could not determine is if WSL is supported on Windows Server 2012 or 2016?

Also, what is the general feeling about how stable Ansible on Windows is?

What approach would you recommend, PS remoting or WSL?

Are there any major differences regarding supported modules with Ansible on Windows I should be aware of?

Best Regards

Hey

At home and for dev work I use Windows 10 and WSL to run Ansible and that works pretty well for me. While this works this method is not supported by Ansible at all and if you come across issues you will usually be asked to replicate it on and actual unix box.

The other issue with this is WSL, only works on Windows 10/Server 2016 and newer. This is also only supported by Microsoft for development purposes and is not designed to run in a production setting. So if you really want to run Ansible on Windows your 2 choices are to use WSL for newer OS' or use Cygwin. Both do work but your probably setting yourself up for failure if this is for non development work.

For getting Ansible to talk to a Windows box and executing commands you can do this with Server 2008/Vista onwards as long as some of the earlier versions have powershell 3.0 installed. There are scripts to upgrade powershell available if you have an older version. Ansible uses the WinRM protocol to communicate to the Windows box over HTTP/S which is definitely usable but a bit slower than SSH and at copying files between hosts.

Hopefully this answers your questions.

Timothy, I’m not quite getting what you’re trying to accomplish. Let’s just get terminology out of the way first:

  1. An ansible environment consists of a control node, and on or multiple target nodes. The control node is where you “run ansible”, and it reaches out to the target nodes (for target nodes running Windows, this typically happens using WinRM)
  2. Ansible supports windows-based target nodes, but not control nodes. You still need a Linux node as a control node, although many are using WSL for dev/test.
  3. WSL is currently not available on Windows 2016, only Windows 10. Microsoft has announced plans for WSL on Server tho, but it’s kinda not that relevant in this context (imho).
  4. As far as support for Windows 2016 goes, it should be fully supported as an Ansible target node

If you could explain a bit more I’m sure theres a bunch of people here who are ready to help

-Trond