How to install Ansible

How to install Ansible

1. Purpose

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.

2. Scope

Included

  1. Control Node Requirements

  2. OS-Specific installation steps

  3. Version validation

  4. Upgrade and removal

  5. Common installation issues

3. Supported Platforms

  1. Ubuntu 20.04/22.04/24.04

  2. Debian 11/12

  3. RHEL 8/9

  4. Rocky Linux 8/9

4. Prerequisites

  1. Root or sudo privileges

  2. Python 3.8 or higher

  3. Outbound internet access to OS repositories

  4. Verify prerequisites:

python3 --version sudo whoami

5. Installation Procedures

5.1 Ubuntu / Debian

sudo apt update sudo apt install -y software-properties-common sudo apt install -y ansible

Check version:

ansible --version

5.2 RHEL / Rocky

sudo dnf install -y epel-release sudo dnf install -y ansible-core

Optional full package:

sudo dnf install -y ansible

Verify:

ansible --version

  1. Version 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


  1. Upgrade Procedure

Ubuntu / Debian

sudo apt update sudo apt upgrade -y ansible

RHEL-based

sudo dnf upgrade -y ansible-core

  1. Removal Procedure

Ubuntu / Debian

sudo apt remove -y ansible sudo apt autoremove -y

RHEL-based

sudo dnf remove -y ansible ansible-core

    • Related Articles

    • Install Rocky Linux 9.2

      What is Rocky Linux? Rocky Linux is a Linux distribution developed by Rocky Enterprise Software Foundation, which is a privately owned benefit corporation that describes itself as a "self-imposed not-for-profit". It is intended to be a downstream, ...
    • How to Attach/Install License on UFM Appliance

      Get the License You can get a 60-day free evaluation license by applying via this link: NVIDIA License Portal Licenses can be purchased via the NVIDIA Sales Team. Licenses are calculated based on the number of HCA Adapters managed by the UFM. ...
    • M.2 drives not detecting after VROC install on ASUS server

      Issue: M.2 drives not detecting on ASUS Server Cause: VROC doesn’t work if CSM mode enabled. Also Broadcom menu item will disappear if CSM mode enabled (Broadcom BIOS will use legacy tool for RAID creation). Solution: Re-flashed the BIOS ...
    • Installing NVIDIA Drivers on Ubuntu

      Ubuntu doesn't come with NVIDIA drivers installed by default as they are proprietary and closed-source. This means that you'll have issues like poor performance, displays not working, artifacts etc... while using the FOSS nouveau drivers. Graphical ...
    • Installation of Performance test and Burnin Test tools in USB device

      Performance Test Performance test is an industry standard in PC Benchmarking software that allows us to quickly assist the performance of the PC and compare to the rest of the world. We can download the software free from link - Performance Test. You ...