Ansible, Windows and PowerShell: the Basics - Introduction

Back in June of this year I presented a session at PowerShell Southampton on using Ansible and PowerShell together. There was a fair amount of interest in this topic both at the event and online afterwards, so I decided to follow it up here with a series of posts looking at the basics for someone getting started with Ansible. In particular using it to automate and configure Windows, where to use PowerShell for that task and sometimes where not to if there is native functionality already available within Ansible.

First of all the presentation from that evening can be found below:

The best place to start with this topic I found was the Ansible documentation for Windows modules. Looking at the list on this page gives a very good indication of what is possible for Windows natively in Ansible, i.e. what you will not need to use your own PowerShell code for.

You can follow through the link to each module and you will typically find excellent examples on how to use it and definitions of each parameter accepted.

The source code for each of the Windows Modules is available on GitHub, so it is possible to dig further to see how they work and also to contribute if you wish to make an improvement or fix.

Most of these modules are using PowerShell to carry out their tasks, so effectively you are using PowerShell in Ansible when using one of these modules, however it saves you the effort of needing to write the code yourself.

In subsequent posts in this series, we will look at some practical examples using Ansible, Windows and PowerShell.