In this blog post, I will explain how we use Ansible to manage Windows machines.
To manage Windows machines, we need to have an Ansible environment up and running on a Linux host.
Get Started
Basic
The basics of managing windows machines with Ansible are:
- Understand core components
- Adding our machines to an Ansible inventory and setup WinRM
- Setup an Ansible Linux control node
- Create a playbook and running it
If you follow the above steps, the next section is all about changing your working configuration and running playbooks.
Modules
Ansible is using modules to manage any aspect of Windows machines.
All the Ansible Windows modules are available in the following URL.
https://docs.ansible.com/ansible/latest/modules/list_of_windows_modules.html
The great thing about Ansible is that the configuration and options are well documented.
For example, to manage Windows services with Ansible, we will use the Win_service module.
https://docs.ansible.com/ansible/latest/modules/win_service_module.html#win-service-module
In the examples section of the documentation, we can review a few basic examples and work our way to configure Ansible.
Conclusion
Ansible is a great tool that gives us the capabilities to manage our Windows server environment and zero cost, however, believe the learning curve is hard since the configuration is driven from Linux, which is not the natural environment of many Windows engineers.