This article provides a focused, crystal-clear procedure strictly for installing Ansible on the control node and validating the installation. It excludes inventories, playbooks, and advanced configuration, making it suitable for baseline OS provisioning and enterprise standards.
Included
Control Node Requirements
OS-Specific installation steps
Version validation
Upgrade and removal
Common installation issues
Ubuntu 20.04/22.04/24.04
Debian 11/12
RHEL 8/9
Rocky Linux 8/9
Root or sudo privileges
Python 3.8 or higher
Outbound internet access to OS repositories
Verify prerequisites:
python3 --version
sudo whoami sudo apt update
sudo apt install -y software-properties-common
sudo apt install -y ansibleCheck version:
ansible --version5.2 RHEL / Rocky
sudo dnf install -y epel-release
sudo dnf install -y ansible-coreOptional full package:
sudo dnf install -y ansibleVerify:
ansible --versionVersion and Environment Validation
ansible --version
which ansible
python3 -c "import ansible; print(ansible.__version__)"Expected:
Ansible binary available
Python interpreter detected
No module imports errors
Upgrade Procedure
Ubuntu / Debian
sudo apt update
sudo apt upgrade -y ansibleRHEL-based
sudo dnf upgrade -y ansible-coreRemoval Procedure
Ubuntu / Debian
sudo apt remove -y ansible
sudo apt autoremove -yRHEL-based
sudo dnf remove -y ansible ansible-core