How to install Ansible in Oracle Linux 8 - Ansible install
By Luca Berton · Published 2024-01-01 · Category: installation
Learn how to install the latest Ansible release on Oracle Linux 8 using the oracle-epel-release-el8 repository with a simple script.

How to install Ansible in Oracle Linux 8
- use Extra Packages for Enterprise Linux (EPEL) additional packages for Enterprise Linux: Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Linux (OL)
See also: How to install Ansible in Oracle Linux 9 - Ansible install
Links
## Playbook
Install latest Ansible release in Oracle Linux 8.
code
- Install-Ansible-OracleLinux8.sh
#!/bin/bash
sudo yum install oracle-epel-release-el8
sudo yum install ansible
execution
$ ssh devops@oraclelinux.example.com
Welcome to Oracle Linux Server release 8.5 (GNU/Linux 5.4.17-2136.300.7.el8uek.x86_64)
The Oracle Linux End-User License Agreement can be viewed here:
* /usr/share/eula/eula.en_US
For additional packages, updates, documentation and community help, see:
* https://yum.oracle.com/
Last login: Fri Jan 21 09:09:29 2022 from 192.168.0.101
[devops@demo ~]$ sudo su
[root@demo devops]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.5 (Ootpa)
[root@demo devops]# cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="8.5"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.5"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:5:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.5
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.5
[root@demo devops]# hostnamectl
Static hostname: demo.example.com
Icon name: computer-vm
Chassis: vm
Machine ID: b6a0872df74a4344931618a6b39ff738
Boot ID: be88c593add3426a996483719c7c6a47
Virtualization: oracle
Operating System: Oracle Linux Server 8.5
CPE OS Name: cpe:/o:oracle:linux:8:5:server
Kernel: Linux 5.4.17-2136.300.7.el8uek.x86_64
Architecture: x86-64
[root@demo devops]# uname -a
Linux demo.example.com 5.4.17-2136.300.7.el8uek.x86_64 #2 SMP Fri Oct 8 16:23:01 PDT 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@demo devops]# dnf info ansible
Last metadata expiration check: 0:47:09 ago on Fri 21 Jan 2022 09:55:33 AM UTC.
Error: No matching Packages to list
[root@demo devops]# dnf search epel
Last metadata expiration check: 0:47:22 ago on Fri 21 Jan 2022 09:55:33 AM UTC.
================================== Name & Summary Matched: epel ===================================
oracle-epel-release-el8.src : Extra Packages for Enterprise Linux (EPEL) yum repository
: configuration
oracle-epel-release-el8.x86_64 : Extra Packages for Enterprise Linux (EPEL) yum repository
: configuration
[root@demo devops]# dnf install oracle-epel-release-el8
Last metadata expiration check: 0:47:48 ago on Fri 21 Jan 2022 09:55:33 AM UTC.
Dependencies resolved.
===================================================================================================
Package Architecture Version Repository Size
===================================================================================================
Installing:
oracle-epel-release-el8 x86_64 1.0-3.el8 ol8_baseos_latest 15 k
Installing dependencies:
yum-utils noarch 4.0.21-3.0.1.el8 ol8_baseos_latest 72 k
Transaction Summary
===================================================================================================
Install 2 Packages
Total download size: 88 k
Installed size: 40 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): oracle-epel-release-el8-1.0-3.el8.x86_64.rpm 99 kB/s | 15 kB 00:00
(2/2): yum-utils-4.0.21-3.0.1.el8.noarch.rpm 366 kB/s | 72 kB 00:00
---------------------------------------------------------------------------------------------------
Total 434 kB/s | 88 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : yum-utils-4.0.21-3.0.1.el8.noarch 1/2
Installing : oracle-epel-release-el8-1.0-3.el8.x86_64 2/2
Running scriptlet: oracle-epel-release-el8-1.0-3.el8.x86_64 2/2
Verifying : oracle-epel-release-el8-1.0-3.el8.x86_64 1/2
Verifying : yum-utils-4.0.21-3.0.1.el8.noarch 2/2
Installed:
oracle-epel-release-el8-1.0-3.el8.x86_64 yum-utils-4.0.21-3.0.1.el8.noarch
Complete!
[root@demo devops]# dnf info ansible
Oracle Linux 8 EPEL Packages for Development (x86_64) 5.1 MB/s | 26 MB 00:05
Last metadata expiration check: 0:00:07 ago on Fri 21 Jan 2022 10:43:36 AM UTC.
Available Packages
Name : ansible
Version : 2.9.27
Release : 1.el8
Architecture : noarch
Size : 17 M
Source : ansible-2.9.27-1.el8.src.rpm
Repository : ol8_developer_EPEL
Summary : SSH-based configuration management, deployment, and task execution system
URL : http://ansible.com
License : GPLv3+
Description : Ansible is a radically simple model-driven configuration management,
: multi-node deployment, and remote task execution system. Ansible works
: over SSH and does not require any software or daemons to be installed
: on remote nodes. Extension modules can be written in any language and
: are transferred to managed machines automatically.
Name : ansible
Version : 2.9.27
Release : 1.el8
Architecture : src
Size : 14 M
Source : None
Repository : ol8_developer_EPEL
Summary : SSH-based configuration management, deployment, and task execution system
URL : http://ansible.com
License : GPLv3+
Description : Ansible is a radically simple model-driven configuration management,
: multi-node deployment, and remote task execution system. Ansible works
: over SSH and does not require any software or daemons to be installed
: on remote nodes. Extension modules can be written in any language and
: are transferred to managed machines automatically.
[root@demo devops]# dnf install ansible
Last metadata expiration check: 0:00:20 ago on Fri 21 Jan 2022 10:43:36 AM UTC.
Dependencies resolved.
===================================================================================================
Package Arch Version Repository Size
===================================================================================================
Installing:
ansible noarch 2.9.27-1.el8 ol8_developer_EPEL 17 M
Installing dependencies:
python3-babel noarch 2.5.1-7.el8 ol8_appstream 4.8 M
python3-cffi x86_64 1.14.3-2.el8 ol8_developer_EPEL 249 k
python3-cryptography x86_64 3.3.1-2.el8 ol8_developer_EPEL 555 k
python3-idna noarch 2.5-5.el8 ol8_baseos_latest 97 k
python3-jinja2 noarch 2.10.1-3.el8 ol8_appstream 538 k
python3-jmespath noarch 0.9.0-11.el8 ol8_appstream 45 k
python3-markupsafe x86_64 0.23-19.el8 ol8_appstream 39 k
python3-pip noarch 9.0.3-20.el8 ol8_appstream 20 k
python3-ply noarch 3.9-9.el8 ol8_baseos_latest 111 k
python3-pycparser noarch 2.14-14.el8 ol8_baseos_latest 109 k
python3-pytz noarch 2017.2-9.el8 ol8_appstream 54 k
python3-pyyaml x86_64 3.12-12.el8 ol8_baseos_latest 193 k
python3-setuptools noarch 39.2.0-6.el8 ol8_baseos_latest 163 k
python36 x86_64 3.6.8-38.module+el8.5.0+20329+5c5719bc ol8_appstream 19 k
sshpass x86_64 1.06-9.el8 ol8_developer_EPEL 28 k
Enabling module streams:
python36 3.6
Transaction Summary
===================================================================================================
Install 16 Packages
Total download size: 24 M
Installed size: 125 M
Is this ok [y/N]: y
Downloading Packages:
(1/16): python3-cffi-1.14.3-2.el8.x86_64.rpm 544 kB/s | 249 kB 00:00
(2/16): python3-cryptography-3.3.1-2.el8.x86_64.rpm 1.2 MB/s | 555 kB 00:00
(3/16): sshpass-1.06-9.el8.x86_64.rpm 621 kB/s | 28 kB 00:00
(4/16): python3-idna-2.5-5.el8.noarch.rpm 805 kB/s | 97 kB 00:00
(5/16): python3-ply-3.9-9.el8.noarch.rpm 844 kB/s | 111 kB 00:00
(6/16): python3-pyyaml-3.12-12.el8.x86_64.rpm 1.1 MB/s | 193 kB 00:00
(7/16): python3-setuptools-39.2.0-6.el8.noarch.rpm 2.3 MB/s | 163 kB 00:00
(8/16): python3-pycparser-2.14-14.el8.noarch.rpm 236 kB/s | 109 kB 00:00
(9/16): python3-jinja2-2.10.1-3.el8.noarch.rpm 708 kB/s | 538 kB 00:00
(10/16): python3-jmespath-0.9.0-11.el8.noarch.rpm 227 kB/s | 45 kB 00:00
(11/16): python3-markupsafe-0.23-19.el8.x86_64.rpm 256 kB/s | 39 kB 00:00
(12/16): python3-pip-9.0.3-20.el8.noarch.rpm 39 kB/s | 20 kB 00:00
(13/16): python3-babel-2.5.1-7.el8.noarch.rpm 2.6 MB/s | 4.8 MB 00:01
(14/16): python3-pytz-2017.2-9.el8.noarch.rpm 796 kB/s | 54 kB 00:00
(15/16): python36-3.6.8-38.module+el8.5.0+20329+5c5719bc.x86_64.rp 473 kB/s | 19 kB 00:00
(16/16): ansible-2.9.27-1.el8.noarch.rpm 3.6 MB/s | 17 MB 00:04
---------------------------------------------------------------------------------------------------
Total 5.1 MB/s | 24 MB 00:04
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-jmespath-0.9.0-11.el8.noarch 1/16
Installing : python3-setuptools-39.2.0-6.el8.noarch 2/16
Installing : python3-pip-9.0.3-20.el8.noarch 3/16
Installing : python36-3.6.8-38.module+el8.5.0+20329+5c5719bc.x86_64 4/16
Running scriptlet: python36-3.6.8-38.module+el8.5.0+20329+5c5719bc.x86_64 4/16
Installing : python3-pytz-2017.2-9.el8.noarch 5/16
Installing : python3-babel-2.5.1-7.el8.noarch 6/16
Installing : python3-markupsafe-0.23-19.el8.x86_64 7/16
Installing : python3-jinja2-2.10.1-3.el8.noarch 8/16
Installing : python3-pyyaml-3.12-12.el8.x86_64 9/16
Installing : python3-ply-3.9-9.el8.noarch 10/16
Installing : python3-pycparser-2.14-14.el8.noarch 11/16
Installing : python3-cffi-1.14.3-2.el8.x86_64 12/16
Installing : python3-idna-2.5-5.el8.noarch 13/16
Installing : python3-cryptography-3.3.1-2.el8.x86_64 14/16
Installing : sshpass-1.06-9.el8.x86_64 15/16
Installing : ansible-2.9.27-1.el8.noarch 16/16
Running scriptlet: ansible-2.9.27-1.el8.noarch 16/16
Verifying : ansible-2.9.27-1.el8.noarch 1/16
Verifying : python3-cffi-1.14.3-2.el8.x86_64 2/16
Verifying : python3-cryptography-3.3.1-2.el8.x86_64 3/16
Verifying : sshpass-1.06-9.el8.x86_64 4/16
Verifying : python3-idna-2.5-5.el8.noarch 5/16
Verifying : python3-ply-3.9-9.el8.noarch 6/16
Verifying : python3-pycparser-2.14-14.el8.noarch 7/16
Verifying : python3-pyyaml-3.12-12.el8.x86_64 8/16
Verifying : python3-setuptools-39.2.0-6.el8.noarch 9/16
Verifying : python3-babel-2.5.1-7.el8.noarch 10/16
Verifying : python3-jinja2-2.10.1-3.el8.noarch 11/16
Verifying : python3-jmespath-0.9.0-11.el8.noarch 12/16
Verifying : python3-markupsafe-0.23-19.el8.x86_64 13/16
Verifying : python3-pip-9.0.3-20.el8.noarch 14/16
Verifying : python3-pytz-2017.2-9.el8.noarch 15/16
Verifying : python36-3.6.8-38.module+el8.5.0+20329+5c5719bc.x86_64 16/16
Installed:
ansible-2.9.27-1.el8.noarch python3-babel-2.5.1-7.el8.noarch
python3-cffi-1.14.3-2.el8.x86_64 python3-cryptography-3.3.1-2.el8.x86_64
python3-idna-2.5-5.el8.noarch python3-jinja2-2.10.1-3.el8.noarch
python3-jmespath-0.9.0-11.el8.noarch python3-markupsafe-0.23-19.el8.x86_64
python3-pip-9.0.3-20.el8.noarch python3-ply-3.9-9.el8.noarch
python3-pycparser-2.14-14.el8.noarch python3-pytz-2017.2-9.el8.noarch
python3-pyyaml-3.12-12.el8.x86_64 python3-setuptools-39.2.0-6.el8.noarch
python36-3.6.8-38.module+el8.5.0+20329+5c5719bc.x86_64 sshpass-1.06-9.el8.x86_64
Complete!
[root@demo devops]# ansible --version
ansible 2.9.27
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.6/site-packages/ansible
executable location = /bin/ansible
python version = 3.6.8 (default, Nov 10 2021, 06:50:23) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3.0.2)]
[root@demo devops]# dnf info ansible | head
Last metadata expiration check: 0:01:00 ago on Fri 21 Jan 2022 10:43:36 AM UTC.
Installed Packages
Name : ansible
Version : 2.9.27
Release : 1.el8
Architecture : noarch
Size : 96 M
Source : ansible-2.9.27-1.el8.src.rpm
Repository : @System
From repo : ol8_developer_EPEL
[root@demo devops]#before execution
# dnf info ansible
Oracle Linux 8 EPEL Packages for Development (x86_64) 5.1 MB/s | 26 MB 00:05
Last metadata expiration check: 0:00:07 ago on Fri 21 Jan 2022 10:43:36 AM UTC.
Available Packages
Name : ansible
Version : 2.9.27
Release : 1.el8
Architecture : noarch
Size : 17 M
Source : ansible-2.9.27-1.el8.src.rpm
Repository : ol8_developer_EPEL
Summary : SSH-based configuration management, deployment, and task execution system
URL : http://ansible.com
License : GPLv3+
Description : Ansible is a radically simple model-driven configuration management,
: multi-node deployment, and remote task execution system. Ansible works
: over SSH and does not require any software or daemons to be installed
: on remote nodes. Extension modules can be written in any language and
: are transferred to managed machines automatically.
Name : ansible
Version : 2.9.27
Release : 1.el8
Architecture : src
Size : 14 M
Source : None
Repository : ol8_developer_EPEL
Summary : SSH-based configuration management, deployment, and task execution system
URL : http://ansible.com
License : GPLv3+
Description : Ansible is a radically simple model-driven configuration management,
: multi-node deployment, and remote task execution system. Ansible works
: over SSH and does not require any software or daemons to be installed
: on remote nodes. Extension modules can be written in any language and
: are transferred to managed machines automatically.
[root@demo devops]#
after execution
# dnf info ansible
Last metadata expiration check: 0:18:46 ago on Fri 21 Jan 2022 10:43:36 AM UTC.
Installed Packages
Name : ansible
Version : 2.9.27
Release : 1.el8
Architecture : noarch
Size : 96 M
Source : ansible-2.9.27-1.el8.src.rpm
Repository : @System
From repo : ol8_developer_EPEL
Summary : SSH-based configuration management, deployment, and task
: execution system
URL : http://ansible.com
License : GPLv3+
Description : Ansible is a radically simple model-driven configuration
: management, multi-node deployment, and remote task execution
: system. Ansible works over SSH and does not require any software
: or daemons to be installed on remote nodes. Extension modules can
: be written in any language and are transferred to managed
: machines automatically.
Available Packages
Name : ansible
Version : 2.9.27
Release : 1.el8
Architecture : src
Size : 14 M
Source : None
Repository : ol8_developer_EPEL
Summary : SSH-based configuration management, deployment, and task
: execution system
URL : http://ansible.com
License : GPLv3+
Description : Ansible is a radically simple model-driven configuration
: management, multi-node deployment, and remote task execution
: system. Ansible works over SSH and does not require any software
: or daemons to be installed on remote nodes. Extension modules can
: be written in any language and are transferred to managed
: machines automatically.
[root@demo devops]#Conclusion
Now you know how to install the latest version of Ansible in Oracle Linux using the EPEL repository.
See also: Run RHEL 9.2 on Mac Using VMware Fusion: A Step-by-Step Guide
Related Articles
Category: installation
Watch the video: How to install Ansible in Oracle Linux 8 - Ansible install — Video Tutorial