Would you like to install ansible on your windows ?
Natively this is not possible. Ansible is only supported on Linux, but it is now possible to install Linux on Windows without using a virtual machine (WSL).
Without having WSL enabled on that machine, it will not be possible to continue this tutorial. So just do it now !
Once WSL is activated, the installation of Ansible remains standard. Here is how you can do it:
We will take as an example a machine running Ubuntu 20.04:
sudo apt-get update sudo apt-get -y install software-properties-common sudo apt-add-repository -y ppa:ansible/ansible sudo apt-get -y install ansible
Ubuntu packages can be built from source with this command:
First of all modify the source file to be able to fetch the packages, for that add the line to the /etc/apt/sources.list file:
deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main
Then run the commands:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 sudo apt update sudo apt install ansible
To install ansible on Fedora, nothing could be simpler, run this command:
sudo dnf install ansible
In order to make sure that Ansible is running on our machine, we will run a simple module on our machine to retrieve local facts:
ansible localhost -m setup
If the command gives you all the facts about your machine, and your installation is working properly, you can start using it.
Want to know more about ansible facts? You can read this post that gives you the 10 most useful facts for Ansible !