This is one of the new things we are going to perform now. Until now, we have been setting up things in Linux based operating systems. Now we are going to set up IIS web server in the Windows operating system, which requires that we enable the WinRM
feature in Windows services to perform Ansible playbook execution.
We need to make sure that the pywinrm
module is installed in the control machine; we can install it by executing the following pip
command:
pip install "pywinrm>=0.2.2"
To simplify this process, Ansible provides a PowerShell script, which needs to be run as an administrator in the PowerShell console. Download the PowerShell script from https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1.
On a Windows machine, open the command prompt as an administrator and run the following command:
powershell.exe -File ConfigureRemotingForAnsible.ps1 -CertValidityDays 100