DevOps | Scripts | Automation

Ansible

Ansible Installation on Ubuntu – Part I

Hello guys,
Welcome to my new post today. This article is for installing ansible on the ubuntu server. Folks who are new to ansible need to know that the ansible is the most commonly used for Infrastructure code (Infrastructure as a code – IaaC) and can learn about the ansible from the website below.
https://www.ansible.com/

This article demonstrates the installing ansible on the Ubuntu server and as this is a demo environment, we are using the basic configuration for the ansible server.
Operating System: Ubuntu 20.10 server
Number of Processors: 2
RAM – 4GB
Disk – 20GB

If you are setting up for the organization you may need higher configuration like 16GB RAM, 100-200GB disk, and 6-8 core processors. You can download the ubuntu server from https://ubuntu.com/download/server. This article doesn’t explain how to install the Ubuntu server. We are assuming you have installed the ubuntu Virtual machine and we will start the ansible installation.

This installation is for the demo purpose, but when you plan to deploy the Ansible tower, you need to make sure that your operating system is compatible with the Tower version. To plan the ansible tower-related installation, use the below required OS.

https://docs.ansible.com/ansible-tower/2.2.2/html/installandreference/requirements_refguide.html

Check the Python version

It might possible that Ubuntu ships with the default Python installation. Before installing the Ansible we need to make sure that the Python3 version is installed. We don’t need to install the Python2 version because Ansible adds and upgrades new modules and they are compatible with the new python versions. Run the below command to check if you have the Python2 version running.

python --version

If you find the python version, run the below command to remove python version.

sudo apt autoremove Python

To install the latest python3 version or other python3 version using the below command,

sudo apt install Python3.8

Once you have the latest python3 version, check the python3 version using,

 python3 --version

You will get the installed python3 version output as shown below.

In the next part we will prepare the Ubuntu server for ansible installation and we will install the ansible server.