Step 1: Prepare the Control Node (your machine)

This is the computer/server where you’ll install Ansible.

  1. Update system
sudo apt update && sudo apt upgrade -y     # Ubuntu/Debian
sudo yum update -y                         # CentOS/RHEL

  1. Install Python (if not already installed)
sudo apt install python3 -y

Check:

python3 --version

  1. Install Ansible
sudo apt install ansible -y

pip install ansible

Check:

ansible --version


Step 2: Prepare Managed Nodes (servers you’ll control)

Install Python if missing: