Setting up WINRM on Ansible windows Node
WINRM Setup
Ansible requires PowerShell version 3.0 and .NET Framework 4.0 or newer to function on older operating systems like Server 2008 and Windows 7.
The base image does not meet this
requirement. You can use the Upgrade-PowerShell.ps1 script to update these.
Once Powershell has been upgraded to at least version 3.0, the final step is to configure the WinRM service so that Ansible can connect to it. The WinRM service has two major components that manage how Ansible interacts with the Windows host. Listener and service configuration settings.
The details of each component will be described later,
but you can use the script ConfigureRemotingForAnsible.ps1 to configure the basics. This script sets up the HTTP and HTTPS listeners using self-signed certificates and enables the basic authentication options of the service.
To use this script, run the following command in PowerShell:
#D: \> \ ConfigureRemotingForAnsible.ps1
The WinRM service listens for requests on one or more ports. You need to create and configure a listener for each port.
To verify that the current listener is running on the WinRM service, run the following command in PowerShell:
#winrm enumerate winrm/config/Listener
Listening ports are 5985 & 5986.
Relevant Blogs:
Recent Comments
No comments
Leave a Comment
We will be happy to hear what you think about this post