Professional Documents
Culture Documents
Ansible Configuration-Windows
Ansible Configuration-Windows
CONFIGURATION
1
1. System Requirements
OS: Windows 10/11 as destination host.
Ubuntu 20.04 as ansible controller. [Internal PatchManager]
Note: The path in section 2.6 may vary. Kindly verify the powershell.exe path before adding it in
the configuration file.
2
3. Windows Configuration [Destination]
3.1. Upgrading PowerShell and .NET Framework
S. No. Description Commands
3.1.1 Set the TLS protocol to 1.2 [Net.ServicePointManager]::SecurityProtocol =
[Net.SecurityProtocolType]::Tls12
3.1.2 Define the script URL. $url =
"https://raw.githubusercontent.com/jborean93/ansi
ble-windows/master/scripts/Upgrade-
PowerShell.ps1"
3.1.3 Define the download path. $file = "$env:temp\Upgrade-PowerShell.ps1"
3.1.4 Specify the username and $username = "Administrator"
password for authentication. $password = "Password"
(modify these with actual
credentials)
3.1.5 Download the script from (New-Object -TypeName
the URL to the specified file System.Net.WebClient).DownloadFile($url, $file)
path.
3.1.6 Set the execution policy to Set-ExecutionPolicy -ExecutionPolicy Unrestricted -
Unrestricted. Force
3.1.7 Run the downloaded script &$file -Version 5.1 -Username $username -Password
with the specified $password -Verbose
parameters.
(New-Object -TypeName
System.Net.WebClient).DownloadFile($url, $file)
3.2.3 Execute the script powershell.exe -ExecutionPolicy ByPass -File $file -Verbose
3
S. No. Description Commands
3.3.1 Check the net connection profile Get-NetConnectionProfile
Note: Kindly update the <IP>, <username> & <password> in section 4.3 and <playbook-
name> & <package-id> in section 4.4.
Warning Note: Always keep the configuration in section 4.2 commented, as failing to do so may
lead to interference with the playbook configuration and result in undesired outcomes. Use
these lines solely for verifying the connection.