We earn commission when you buy through affiliate links.

This does not influence our reviews or recommendations.Learn more.

Let me quickly show you how to connect the Windows server from Ansible running on Ubuntu.

ansible user

To follow the steps below, you better have Python 3.x and Ansible installed on both the systems.

you’ve got the option to follow the below articles if you need help.

How to Install and Configure Ansible on Ubuntu?

ansible groups

How to install Ansible on Windows?

Now, an ansible user on a windows machine is ready.

WinRM stands for windows remote management.

It allows you to perform management tasks on remote windows systems.

We will installpython3-winrm, a python client that is used to make a connection to the windows system.

So now ansible will know which windows system it needs to connect.

Step 5: Configure Windows Servers to Manage

Open your windows power shell and upgrade it.

it’s crucial that you have Powershell 3.0 and .NET Framework 4.0 present on the windows machine.

To configure WinRM on a Windows system with ansible, a remote configuration script has been provided by ansible.

spin up the script in the PowerShell.

Set winrm to allow HTTP traffic.

Set the authentication to basic in wirm.

Go to ansible controller machine and ping the windows server machine usingwin_pingansible module.

The success message shows that the connection has been established.

Now, the windows system is ready to be administered remotely from the Ansible running on Ubuntu.