How to install ansible on Linux Fedora 37/Centos9/RHEL9?

How to install ansible on Linux Fedora 37 / Centos9 / RHEL 9?

Let’s see how to install ansible on linux fedora 37/ centos 9 /RHEL9.

Check whether ansible is already installed or not.

[ramyadevi@fedora ~]$ ansible --version

Got below error,

bash: ansible: command not found...
Install package 'ansible-core' to provide command 'ansible'? [N/y] ^[c^C

Looks like ansible is not installed on linux fedora 37.

We can install ansible on linux fedora 37/centos 9/ RHEL9 using yum install or dnf install command.

[ramyadevi@fedora ~]$ yum install ansible

Need to use sudo or root privileges to install ansible, otherwise below error is raised.

Error: This command has to be run with superuser privileges (under the root user on most systems).

Now try with sudo,

[ramyadevi@fedora ~]$ sudo yum install ansible

ansible installation is started,

Fedora 37 - x86_64 - Updates                                                                                                  170  B/s | 4.9 kB     00:29    
Fedora 37 - x86_64 - Updates                                                                                                  413 kB/s | 3.0 MB     00:07    
Fedora Modular 37 - x86_64 - Updates                                                                                          3.9 kB/s | 4.3 kB     00:01    
Dependencies resolved.
==============================================================================================================================================================
 Package                                     Architecture                    Version                                   Repository                        Size
==============================================================================================================================================================
Installing:
 ansible                                     noarch                          7.3.0-1.fc37                              updates                           45 M
Installing dependencies:
 ansible-core                                noarch                          2.14.3-1.fc37                             updates                          3.7 M
 python3-jinja2                              noarch                          3.0.3-5.fc37                              fedora                           630 k
 python3-resolvelib                          noarch                          0.5.5-6.fc37                              fedora                            43 k

Transaction Summary
==============================================================================================================================================================
Install  4 Packages

Total download size: 49 M
Installed size: 347 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): python3-resolvelib-0.5.5-6.fc37.noarch.rpm                                                                              25 kB/s |  43 kB     00:01    
(2/4): python3-jinja2-3.0.3-5.fc37.noarch.rpm                                                                                 160 kB/s | 630 kB     00:03    
(3/4): ansible-7.3.0-1.fc37.noarch.rpm                                                                                        176 kB/s |  45 MB     04:19    
(4/4): ansible-core-2.14.3-1.fc37.noarch.rpm                                                                                   14 kB/s | 3.7 MB     04:22    
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                         189 kB/s |  49 MB     04:24     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                      1/1 
  Installing       : python3-resolvelib-0.5.5-6.fc37.noarch                                                                                               1/4 
  Installing       : python3-jinja2-3.0.3-5.fc37.noarch                                                                                                   2/4 
  Installing       : ansible-core-2.14.3-1.fc37.noarch                                                                                                    3/4 
  Installing       : ansible-7.3.0-1.fc37.noarch                                                                                                          4/4 
  Running scriptlet: ansible-7.3.0-1.fc37.noarch                                                                                                          4/4 
  Verifying        : python3-jinja2-3.0.3-5.fc37.noarch                                                                                                   1/4 
  Verifying        : python3-resolvelib-0.5.5-6.fc37.noarch                                                                                               2/4 
  Verifying        : ansible-7.3.0-1.fc37.noarch                                                                                                          3/4 
  Verifying        : ansible-core-2.14.3-1.fc37.noarch                                                                                                    4/4 

Installed:
  ansible-7.3.0-1.fc37.noarch      ansible-core-2.14.3-1.fc37.noarch      python3-jinja2-3.0.3-5.fc37.noarch      python3-resolvelib-0.5.5-6.fc37.noarch     

Complete!

Now we can try to see if the ansible version command is working or not.

[ramyadevi@fedora ~]$ ansible --version

Displayed ansible and python version details,

ansible [core 2.14.3]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/ramyadevi/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /home/ramyadevi/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.2 (main, Feb  8 2023, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True



Python installation

Privacy Policy  |  Copyrightcopyright symbol2020 - All Rights Reserved.  |  Contact us   |  Report website issues in Github   |  Facebook page   |  Google+ page

Email Facebook Google LinkedIn Twitter
^