Wednesday, 7 January 2015

Ansible and Windows

I've been tasked to look at various configuration management solutions to setup and manage Windows machine.

As I already use Ansible in quite a few places on Linux, I decided to try the relatively new Windows support (as of 1.7). I set myself a fairly simple task, that is installing and configuring CouchDB from scratch.I later added the ability to install Microsoft Silverlight.

Setting up the Windows environment was fairly straightforward, I just followed the instructions from the Ansible website and I was able to setup my Windows7 box with WinRM.

Ansible has managed to keep the same operating model on both Windows and Linux: it's all agent-less, you can invoke ad-hoc commands on both Windows and Linux, and even write Playbooks where some sections take place on Windows while others on Linux. The list of Windows specific modules is a bit small (but hopefully growing).

For my particular job, I needed to tweak the CouchDB configuration once it is installed. Normally on Linux, I would use the template module, which is not yet available on Windows. I eventually settled for a hybrid option, where I apply the template locally on the Linux 'master' node and then I instruct the Windows box to fetch the templated content via http (I run an HTTP server on my Ansible 'master' node).

Here is what the Playbook looks like: I do find the Windows philosophy for installing software very weird (it mostly assumes a GUI and someone clicking on things to proceed), but thankfully, I was able to work out the steps to install things silently.

Overall, I am quite happy with the result. The next version of Ansible (1.9) should have improved Windows support with extra modules for doing file copy and dealing with templates.

Good job to the Ansible team for keeping it very simple.

7 comments: