https://github.com/lpsouza/windows-installer
This repository hosts Ansible playbooks designed to streamline the installation and configuration of software on Windows systems using Ansible on WSL2.
https://github.com/lpsouza/windows-installer
ansible ansible-playbook installers windows winrm wsl2
Last synced: about 1 month ago
JSON representation
This repository hosts Ansible playbooks designed to streamline the installation and configuration of software on Windows systems using Ansible on WSL2.
- Host: GitHub
- URL: https://github.com/lpsouza/windows-installer
- Owner: lpsouza
- Created: 2023-08-22T18:14:32.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-27T00:14:33.000Z (about 1 year ago)
- Last Synced: 2025-05-27T01:26:39.376Z (about 1 year ago)
- Topics: ansible, ansible-playbook, installers, windows, winrm, wsl2
- Language: Shell
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# windows-installer
Welcome to the Windows Installer repository! This repository hosts Ansible playbooks designed to streamline the installation and configuration of software on Windows systems using Ansible on WSL2.
## Configure WinRM to allow Ansible to connect to Windows
To establish a connection between Ansible and Windows, you'll need to set up the WinRM (Windows Remote Management) service. Follow these steps in an elevated PowerShell session:
```powershell
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$url = "https://raw.githubusercontent.com/ansible/ansible-documentation/devel/examples/scripts/ConfigureRemotingForAnsible.ps1"
$file = "$env:temp\ConfigureRemotingForAnsible.ps1"
(New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file)
powershell.exe -ExecutionPolicy ByPass -File $file
```
In case you encounter the error message `Unable to check the status of the firewall` after running the commands above, execute the following command to address the issue:
```powershell
netsh advfirewall firewall add rule name="Windows Remote Management (HTTP-In)" dir=in action=allow service=any enable=yes profile=any localport=5985 protocol=tcp
netsh advfirewall firewall add rule name="Windows Remote Management (HTTPS-In)" dir=in action=allow service=any enable=yes profile=any localport=5986 protocol=tcp
```
These steps should help establish a secure and seamless connection between Ansible and Windows systems.
## Generate inventory file (WSL2)
```bash
chmod +x ./generate-wsl2-inventory.sh
./generate-wsl2-inventory.sh
```