Description
This article will explain how to get up and running using Ansible in a windows environment.
Installing Ansible on Windows
Install & Configure Windows Subsystem for Linux Version 2 (WSL2)
-
Download this WSL 2 kernel update (required). https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
-
Double-click the wsl_update_x64.msi file and apply the update.
-
Open Start.
-
Search for PowerShell, right-click the top result, and select the Run as administrator option.
-
Run the Following two commands to enable WSL.
> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- Type the following command to set Windows Subsystem for Linux 2 your default architecture for new distros that you install and press Enter:
> wsl --set-default-version 2
- (Optional) To convert the distro from WSL 1 to WSL 2, type the following (depending on which distro(s) you are trying to use) and press Enter:
> wsl --set-version Ubuntu 2
> wsl --set-version kali-linux 2
Download / Install Ubuntu or Kali Linux
If you have not done so alread.
- Download Ubuntu AND/OR Kali Linux from the Windows Store.
Configure WinRM on each Windows Host
Install Asible in Linux Sub-system
- Open Ubuntu
sudo mkdir /etc/ansible
sudo nano /etc/ansible/hosts
Example hosts
file contents;
1 | [web] |
Ignore certificate validation unless a real cert has been issued by a CA.