How to Install Ansible on Rocky Linux 8.6
To install Ansible on Rocky Linux 8.6
Introduction:
Ansible is a simple and easy-to-use server management tool that is used to operate and administer multiple servers from a central computer through SSH. Ansible doesn’t need any configuration on the server side like Chef or Puppet.
Installation Procedure:
Step 1: Check the installed version of OS by using the below command
[root@linuxhelp ~]# cat /etc/os-release
NAME="Rocky Linux"
VERSION="8.6 (Green Obsidian)"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky Linux"
ROCKY_SUPPORT_PRODUCT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8"
Step 2: Update the DNF package repository cache by using the below command
[root@linuxhelp ~]# dnf makecache
Rocky Linux 8 - AppStream 4.9 kB/s | 4.8 kB 00:00
Rocky Linux 8 - AppStream 5.8 MB/s | 9.6 MB 00:01
Rocky Linux 8 - BaseOS 4.7 kB/s | 4.3 kB 00:00
Rocky Linux 8 - BaseOS 4.9 MB/s | 6.7 MB 00:01
Rocky Linux 8 - Extras 3.3 kB/s | 3.5 kB 00:01
Rocky Linux 8 - Extras 11 kB/s | 12 kB 00:01
Extra Packages for Enterprise Linux 8 - x86_64 28 kB/s | 5.3 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 4.8 MB/s | 13 MB 00:02
Extra Packages for Enterprise Linux Modular 8 - x86_64 9.9 kB/s | 8.3 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 1.1 MB/s | 734 kB 00:00
Remi's Modular repository for Enterprise Linux 8 - x86_64 760 B/s | 833 B 00:01
Remi's Modular repository for Enterprise Linux 8 - x86_64 456 kB/s | 1.0 MB 00:02
Safe Remi's RPM repository for Enterprise Linux 8 - x86_64 699 B/s | 833 B 00:01
Safe Remi's RPM repository for Enterprise Linux 8 - x86_64 918 kB/s | 2.2 MB 00:02
Metadata cache created.
Step 3: Enable EPEL repository, install the epel-release package by using the below command
[root@linuxhelp ~]# dnf install epel-release
Last metadata expiration check: 0:00:51 ago on Thu 08 Sep 2022 06:45:34 PM EDT.
Package epel-release-8-15.el8.noarch is already installed.
Dependencies resolved.
=================================================================================================
Package Architecture Version Repository Size
=================================================================================================
Upgrading:
epel-release noarch 8-17.el8 extras 24 k
Transaction Summary
=================================================================================================
Upgrade 1 Package
Total download size: 24 k
Is this ok [y/N]: y
Downloading Packages:
epel-release-8-17.el8.noarch.rpm 87 kB/s | 24 kB 00:00
-------------------------------------------------------------------------------------------------
Total 23 kB/s | 24 kB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: epel-release-8-17.el8.noarch 1/1
Upgrading : epel-release-8-17.el8.noarch 1/2
Running scriptlet: epel-release-8-17.el8.noarch 1/2
Cleanup : epel-release-8-15.el8.noarch 2/2
Running scriptlet: epel-release-8-15.el8.noarch 2/2
Verifying : epel-release-8-17.el8.noarch 1/2
Verifying : epel-release-8-15.el8.noarch 2/2
Upgraded:
epel-release-8-17.el8.noarch
Complete!
Step 4: Again, update the DNF package repository cache by using the below command
[root@linuxhelp ~]# dnf makecache
Rocky Linux 8 - AppStream 6.0 kB/s | 4.8 kB 00:00
Rocky Linux 8 - BaseOS 4.6 kB/s | 4.3 kB 00:00
Rocky Linux 8 - Extras 4.0 kB/s | 3.5 kB 00:00
Rocky Linux 8 - Extras 12 kB/s | 12 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 6.2 kB/s | 5.3 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 9.5 kB/s | 8.3 kB 00:00
Remi's Modular repository for Enterprise Linux 8 - x86_64 654 B/s | 833 B 00:01
Safe Remi's RPM repository for Enterprise Linux 8 - x86_64 596 B/s | 833 B 00:01
Metadata cache created.
Step 5: Install Ansible by using the below command
[root@linuxhelp ~]# dnf install ansible
Last metadata expiration check: 0:00:15 ago on Thu 08 Sep 2022 06:47:44 PM EDT.
Dependencies resolved.
=================================================================================================
Package Arch Version Repository Size
=================================================================================================
Installing:
ansible noarch 5.4.0-3.el8 epel 40 M
Installing dependencies:
ansible-core x86_64 2.12.2-4.el8_6.rocky.0.1 appstream 2.4 M
git x86_64 2.31.1-2.el8 appstream 160 k
git-core x86_64 2.31.1-2.el8 appstream 4.7 M
git-core-doc noarch 2.31.1-2.el8 appstream 2.6 M
perl-Error noarch 1:0.17025-2.el8 appstream 45 k
perl-Git noarch 2.31.1-2.el8 appstream 77 k
perl-TermReadKey x86_64 2.37-7.el8 appstream 39 k
python38 x86_64 3.8.12-1.module+el8.6.0+794+eba84017 appstream 78 k
python38-asn1crypto noarch 1.2.0-3.module+el8.4.0+570+c2eaf144 appstream 183 k
python38-babel noarch 2.7.0-11.module+el8.5.0+672+ab6eb015 appstream 5.9 M
python38-cffi x86_64 1.13.2-3.module+el8.4.0+570+c2eaf144 appstream 247 k
python38-cryptography x86_64 2.8-3.module+el8.5.0+672+ab6eb015 appstream 552 k
python38-idna noarch 2.8-6.module+el8.4.0+570+c2eaf144 appstream 86 k
python38-jinja2 noarch 2.10.3-5.module+el8.5.0+672+ab6eb015 appstream 262 k
python38-libs x86_64 3.8.12-1.module+el8.6.0+794+eba84017 appstream 8.3 M
python38-markupsafe x86_64 1.1.1-6.module+el8.4.0+570+c2eaf144 appstream 35 k
python38-pip-wheel noarch 19.3.1-5.module+el8.6.0+794+eba84017 appstream 1.0 M
Complete!
Step 6: Check the Ansible version by using the below command
[root@linuxhelp ~]# ansible --version
ansible [core 2.12.2]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.8/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.8.12 (default, May 10 2022, 23:46:40) [GCC 8.5.0 20210514 (Red Hat 8.5.0-10)]
jinja version = 2.10.3
libyaml = True
Conclusion:
We have reached the end of this article. In this guide, we have walked you through the steps required to Install Ansible on Rocky Linux 8.6. Your feedback is much welcome.