Installing Ansible on Ubuntu 22.04

Installing Ansible on Ubuntu 22.04

Ansible is an open-source automation tool that simplifies configuration management, application deployment, and task automation.

Step 1: Update the System Package

sudo apt update

Step 2: Install Python

Ansible requires Python, so you need to install Python and pip, the Python package manager:

sudo apt install -y python3 python3-pip

Verify the Python installation by checking the version:

python3 --version

Step 3: Add the Ansible PPA (Personal Package Archive)

To install the latest version of Ansible, add the official Ansible PPA to your system:

sudo apt update

Add the Ansible PPA (Personal Package Archive)

sudo apt install -y software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible

Step 4: Install Ansible

With the PPA added, you can now install Ansible:

sudo apt install -y ansible

Verify the Installation:

To ensure Ansible is installed correctly, check its version:

ansible --version