install ansible on ubuntu 18 and debian 10
Install Ansible on Ubuntu / Debian mayur chavhan

How to install Ansible on Ubuntu 18.04 / Debian 10 Buster

Mayur Chavhan Ansible

Table of Contents

What is Ansible?

ansible

Ansible is an open source DevOps automation tool that solves server provisioning in installing tools, configuration, deployment and provisioning. It leverages SSH to communicate between servers. It uses the playbook which states every steps of automation jobs, and playbook uses a simple language called "YAML".


Prerequisites :

Operating System: Ubuntu 18.04 / Debian 10 Buster

SSH Access :  You need remote server SSH access available with Password or Key Access so our ansible server can communicate remotely.

Python: python version 2.7 or above it should be installed.

 

Before start...

The use of Ansible as a capability of managing your server infrastructure, you want to install the Ansible software program on the machine that will serve as the Ansible manage node.

Ansible’s only real dependency is Python. Once Python is installed, the simplest way to get Ansible running is to use pip, a simple package manager for Python. Don't worry most of the linux distro comes with default Python 2.7 and CentOS 8 comes with built in Python version 3.7.

The easiest way to install Ansible on a Debian or Ubuntu system is to use the official apt package.

Add official Ansible repository


From your ansible host node, run the following command to consist of the authentic project’s PPA and it is needed else you'll end up with older version of Ansible :

sudo apt-add-repository ppa:ansible/ansible

Press ENTER to proceed with PPA addition.

Update Packages

Newly added PPA needs to be updated :

sudo apt update

If an error like “sudo: add-apt-repository: command not found”, then you’re missing the python-software-properties package. Install it with the following command:

sudo apt-get install python-software-properties

Install Ansible 

After update is done, you can easily install Ansible using simple install command,

sudo apt-get install ansible -y

Our installation process has been done. Now let’s check ansible version. 

sudo ansible --version

That's all folks. Happy Hacking!!