Install Ansible on Windows Subsystem Linux

install ubuntu WSL

select windows subsystem linux

install ubuntu from microsoft store

open ubuntu after finished installation

create user sudo in ubuntu wsl when open it first time.

install ansible

add ansible repository

sudo apt-add-repository ppa:ansible/ansible

install ansible

sudo apt install ansible

install python-pip and libssl-dev

sudo apt-get install -y python3-pip libssl-dev

run ansible command on ubuntu wsl

ansible --version

you can also open wsl using windows terminal