Search

How to install ansible on rocky linux 9

How to Install Ansible on Rocky Linux 9

Ansible is a popular open-source automation tool used for configuration management, application deployment, task automation, and many other IT tasks. This guide will walk you through the steps to install Ansible on Rocky Linux 9.

Step 1: Update Your System

Before installing any new software, it's a good practice to update your system's package index and upgrade existing packages. Open a terminal and run the following command:

sudo dnf update -y

Step 2: Enable the EPEL Repository

The Extra Packages for Enterprise Linux (EPEL) repository contains additional software packages not included in the default Rocky Linux repositories. You need to enable it to install Ansible. Execute the following command:

sudo dnf install epel-release -y

Step 3: Install Ansible

With the EPEL repository enabled, you can now install Ansible using the dnf package manager:

sudo dnf install ansible -y

Step 4: Verify the Installation

After the installation completes, you can verify that Ansible is installed correctly by checking its version:

ansible --version

You should see output similar to the following, indicating that Ansible is installed and displaying the version number:

ansible [core 2.12.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.7 (default, Aug 31 2021, 13:28:12) [GCC 10.3.1 20210422 (Red Hat 10.3.1-1)]
  jinja version = 2.11.3
  libyaml = True

Conclusion

You've successfully installed Ansible on your Rocky Linux 9 system. You can now start using Ansible to automate various IT tasks and manage your infrastructure more efficiently. For more information on how to use Ansible, refer to the official Ansible documentation.

Sys Admin

Sys Admin

I am a Red Hat Certified Engineer (RHCE) and working as an IT Professional since 2012...