Open your terminal and run:
sudo apt update
sudo apt upgrade -y
Install Ansible using apt:
sudo apt install ansible -y
Verify the installation by checking the version:
ansible --version
Expected Output Example:

An inventory file lists the hosts you want to manage. For this experiment, you can use the local host.
Create an Inventory File
hosts.ini:gedit hosts.ini