I'm doing some research about managing my Ubuntu servers using
Ansible, but am using a Windows 10 myself and therefore would like to
run Ansible on my Windows host. The servers to manage are Linux only
for now, though. I've already read in the documentation that such a
setup is not supported[1] and about usual workarounds using Cygwin[2]
or the new WSL[3].
What I didn't find yet is thorough documentation about what exactly
doesn't work or better why. People only seem to tell that it doesn't
work and what they use instead, like the mentioned links above, but
not the actual problems they ran into. Looking at e.g. what needs to
be installed for Cygwin, at least many of the software requirements
seem to be available natively under Windows, some of them like cURL,
Python, SSH, OpenSSL etc. are already installed for me.
So, is there any summary of what the key problems are running Ansible
natively under Windows? Something like blog posts, open bugs in GitHub
or such? I didn't find anything.
I’m not aware of any blogs documentation but the biggest reason is that Ansible relies on the fork syscall as part of the worker execution module. The Win32 layer has no concept of fork() and relies on threading to offer a similar alternative for multiprocessing in that world. As for why you can’t use Python modules currently; the main module helper library used to parse the params and validate the input uses some Python libraries like pty which have no equivalent in Windows. TLDR; Ansible uses a lot of POSIX idioms which don’t translate well to Windows.
If you are using Windows 10 I would highly recommend you use WSL and not Cygwin when running Ansible locally. It’s not officially supported but I’ve yet to come across an issue with it and I think Microsoft has done an excellent implementation with that. WSL works because it handles all the POSIX syscalls for you (similar to Cygwin) but is also able to run unmodified ELF binaries (unlike Cygwin).
I’m not an Ansible developer, so I can’t speak for the project, obviously. But I’d guess the reason is that Ansible uses a whole lot of things that are found only in Unix/Linux/BSD operating systems. As a very basic (and fundamental) example, SSH isn’t typically available on Windows. Ansible not only uses SSH to talk to the majority of devices out there, but it very heavily relies on a lot of features built deep into OpenSSH, specifically. Another thing, off the top of my head, is that Windows handles temp files differently, and it’s important to get that right. And so on.
Many things could be compensated for or worked around, but there are so many differences, and the differences are so great, that it would take a lot of programmer time to maintain all the parallel code. Given that programmer time spent on that couldn’t be spent on features and performance and functionality and so on, it’s probably not worth the effort. (Especially given that you can, technically, run it on Windows with the extra effort that you mentioned.)