What is ansible and how to install ansible on linux (Fedora/Centos/RHEL)

Ansible Introduction

Ansible is an IT automation tool and can configure any systems, deploy any software on remote machines, and orchestrate advanced tasks such as continuous deployments or zero downtime rolling updates.

Ansible is simple and ease-of-use.

It is an agentless automation tool and manages machines over the SSH protocol.

it does not need a database and will be no daemons to start or keep running on machines.

We need to install ansible on one machine and it can manage an entire group of remote machines from that central point.

Anisble does not need software installed or running on remote machines when manages remote machines.

How to install ansible on linux(Fedora/Centos/RHEL)?

$ sudo yum install ansible
rdopkg for Fedora 29                                                                                                                     	198  B/s | 341  B 	00:01    
Failed to synchronize cache for repo 'rdopkg'
Ignoring repositories: rdopkg
Last metadata expiration check: 0:00:40 ago on Mon 15 Nov 2021 04:43:31 PM IST.
Dependencies resolved.
=============================================================================================================================================================================
 Package                                     	Architecture                    	Version                                  	Repository                        	Size
=============================================================================================================================================================================
Installing:
 ansible                                     	noarch                          	2.9.25-1.el7                             	epel                              	17 M
Installing dependencies:
 python2-httplib2                            	noarch                          	0.18.1-3.el7                             	epel                             	125 k
 python2-jmespath                            	noarch                          	0.9.4-2.el7                              	epel                              	41 k
 python2-jinja2                              	noarch                          	2.10.1-1.fc29                            	updates                          	528 k
 python2-babel                               	noarch                          	2.6.0-5.fc29                             	fedora                           	5.7 M
 python2-markupsafe                          	x86_64                          	1.0-1.fc29                               	fedora                            	29 k
 python2-pytz                                	noarch                          	2018.5-1.fc29                            	fedora                            	48 k

Transaction Summary
=============================================================================================================================================================================
Install  7 Packages

Total download size: 23 M
Installed size: 131 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): python2-jmespath-0.9.4-2.el7.noarch.rpm                                                                                            	37 kB/s |  41 kB 	00:01    
(2/7): python2-httplib2-0.18.1-3.el7.noarch.rpm                                                                                           	64 kB/s | 125 kB 	00:01    
(3/7): python2-jinja2-2.10.1-1.fc29.noarch.rpm                                                                                           	116 kB/s | 528 kB 	00:04    
(4/7): python2-markupsafe-1.0-1.fc29.x86_64.rpm                                                                                          	127 kB/s |  29 kB 	00:00    
(5/7): python2-pytz-2018.5-1.fc29.noarch.rpm                                                                                             	176 kB/s |  48 kB 	00:00    
(6/7): python2-babel-2.6.0-5.fc29.noarch.rpm                                                                                             	537 kB/s | 5.7 MB 	00:10    
(7/7): ansible-2.9.25-1.el7.noarch.rpm                                                                                                   	1.3 MB/s |  17 MB 	00:13    
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                    	1.3 MB/s |  23 MB 	00:18	 
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing    	:                                                                                                                                                 	1/1
  Installing   	: python2-pytz-2018.5-1.fc29.noarch                                                                                                               	1/7
  Installing   	: python2-babel-2.6.0-5.fc29.noarch                                                                                                               	2/7
  Installing   	: python2-markupsafe-1.0-1.fc29.x86_64                                                                                                            	3/7
  Installing   	: python2-jinja2-2.10.1-1.fc29.noarch                                                                                                             	4/7
  Installing   	: python2-jmespath-0.9.4-2.el7.noarch                                                                                                             	5/7
  Installing   	: python2-httplib2-0.18.1-3.el7.noarch                                                                                                            	6/7
  Installing   	: ansible-2.9.25-1.el7.noarch                                                                                                                     	7/7
  Running scriptlet: ansible-2.9.25-1.el7.noarch                                                                                                                     	7/7
  Verifying    	: ansible-2.9.25-1.el7.noarch                                                                                                                     	1/7
  Verifying    	: python2-httplib2-0.18.1-3.el7.noarch                                                                                                            	2/7
  Verifying    	: python2-jmespath-0.9.4-2.el7.noarch                                                                                                             	3/7
  Verifying    	: python2-jinja2-2.10.1-1.fc29.noarch                                                                                                             	4/7
  Verifying    	: python2-babel-2.6.0-5.fc29.noarch                                                                                                               	5/7
  Verifying    	: python2-markupsafe-1.0-1.fc29.x86_64                                                                                                            	6/7
  Verifying    	: python2-pytz-2018.5-1.fc29.noarch                                                                                                               	7/7

Installed:
  ansible-2.9.25-1.el7.noarch          	python2-httplib2-0.18.1-3.el7.noarch    	python2-jmespath-0.9.4-2.el7.noarch    	python2-jinja2-2.10.1-1.fc29.noarch  	 
  python2-babel-2.6.0-5.fc29.noarch    	python2-markupsafe-1.0-1.fc29.x86_64    	python2-pytz-2018.5-1.fc29.noarch    	 

Complete!

How to build and install ansible?

We can also download and build rpm easily as mentioned below,

Need to download ansilbe code from repo 'https://github.com/ansible/ansible.git' and build using make rpm command.

$ git clone https://github.com/ansible/ansible.git
$ cd ./ansible
$ make rpm
$ sudo rpm -Uvh ./rpm-build/ansible-*.noarch.rpm

How to install ansible using pip?

Ansible can be installed using pip command.

sudo pip install ansible

If pip command is not installed, need to install using below command,

$ sudo yum install python3-pip
or
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python get-pip.py --user



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
^