10 facts in ansible

Introduction and Prerequisites

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:

Install Ansible on Ubuntu

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:

make deb

Install Ansible on Debian

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 trusty main

Then run the commands:

sudo apt-key adv --keyserver --recv-keys 93C4A3FD7BB9C367
sudo apt update
sudo apt install ansible

Install Ansible on Fedora

To install ansible on Fedora, nothing could be simpler, run this command:

sudo dnf install ansible

Test if Ansible is installed correctly

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 !

Leave a Reply

Your email address will not be published. Required fields are marked *