Home » Ansible: Install Ansible on Linux – CentOS 7/RHEL 7

Ansible: Install Ansible on Linux – CentOS 7/RHEL 7

by Pring
Ansible: Install Ansible on Linux – CentOS 7/RHEL 7

I. Introduction.

This article describes how to Install Ansible on RHEL 7/CentOS 7.x

II. Prerequisites.

1. Login to your system via SSH. You can use PuTTy tool or Poderosa tool,…
2. Login with root user.  If you are logged in as another user, you will need to add sudo before each command.

III. How to install Ansible on Linux – CentOS 7 step by step.

To install Ansible on Linux – CentOS 7, the three most common ways to install Ansible will be described in this section.

Option 1: Install Ansible with Yum, follow these steps:
Step 1. Add epel repository.
Step 2. Install Ansible.
Step 3. Verify the installation.


Option 2: Install Ansible with PPA, follow these steps:
Step 1. Install the software-properties-common Package.
Step 2. Add PPA.
Step 3. Update your sources and upgrade your the Package.
Step 4. Install Ansible.
Step 5. Verify the installation.


Option 3: Install Ansible from Source(from .tar file), follow these steps:
Step 1. Update your system.
Step 2. Install dependency or relate package.
Step 3. Install Ansible.
Step 5. Verify the installation.

You can see details of Video on how to install Ansible on Linux – CentOS 7 as below.
[Sorry, the video we will update later]

Or you also can see details as below.

Option 1: Install Ansible with Yum, follow these steps:

Step 1. Add epel repository.

First you need instal epel repository, to install it, enter the command below.

yum install epel-release

Step 2. Install Ansible.

So easy, install ansible with the command below.

yum install ansible

Step 3. Verify the installation.

To check the version of Ansible installed, you can use the following command.

ansible –version


Option 2: Install Ansible with PPA, follow these steps:

Step 1. Install the software-properties-common Package.

First, to get the add-apt-repository command, install the software-properties-common package.
Enter the command below.

apt-get install software-properties-common -y

Step 2. Add PPA.

Then you add the PPA, enter the command below.

apt-add-repository ppa:ansible/ansible -y

Step 3. Update your sources and upgrade your the package.

Next, you need update your sources and upgrade your the package with following command below.

apt-get update -y

Step 4. Install Ansible.

Finally, run following command below to install Ansible

apt-get install ansible -y

Step 5. Verify the installation.

To check the version of Ansible installed, you can use the following command.

ansible –version


Option 3: Install Ansible from Source(from .tar file), follow these steps:

Step 1. Update your system.

First, you need update your system, enther the command below.

sudo apt-get update

Step 2. Install dependency or relate package.

Enter the commands below.

sudo apt-get install python-setuptools python-dev -y
sudo apt-get install git
sudo easy_install pip
sudo pip install PyYAML jinja2 paramiko

Step 3. Install Ansible.

1. First you need get package URL.

Access release page of Ansible to get package URL: https://releases.ansible.com/ansible/

At this article, i use [ ansible-2.0.1.0.tar.gz ] with following url.
https://releases.ansible.com/ansible/ansible-2.0.1.0.tar.gz

2. Dowload Ansible release package(.tar.gz file)

Enter the command below.

cd /tmp
wget http://releases.ansible.com/ansible/ansible-2.0.1.0.tar.gz

3. Unzip Ansible package.

After finished download, you need unzip .tar package. Enter the command below.

tar xvf ansible-2.0.1.0.tar.gz

4. Install Ansible

Finally, run following the command.

cd ansible-2.0.1.0/
sudo make install

Step 5. Verify the installation.

To check the version of Ansible installed, you can use the following command.

ansible –version

IV. Conclusion.

In this tutorial, we was Install Ansible on RHEL 7/CentOS 7 server. If you hit a problem or have feedback, leave a comment below.
You can now visit the official Ansible Documentation page and learn how to get started with Ansible.


Install Ansible on RHEL 7/CentOS 7 is complete. Wish you success and luck.
Thanks and best regards!
— Pring —

Related Articles

4 comments

JeffreyBig January 6, 2020 - 6:11 pm

Hello. I have checked your devopsio.com and i see you’ve got
some duplicate content so probably it is the reason that you don’t rank high in google.
But you can fix this issue fast. There is a tool that generates articles like human,
just search in google: miftolo’s tools

Reply
alcohol rehab nea rme February 27, 2020 - 9:35 pm

Hmm it appears like your site ate my first comment (it was extremely long) so I guess
I’ll just sum it up what I wrote and say, I’m thoroughly enjoying your blog.
I as well am an aspiring blog writer but I’m still new to everything.

Do you have any tips and hints for first-time blog
writers? I’d definitely appreciate it.

Reply
when will cialis go generic June 2, 2020 - 10:58 pm

You actually make it seem really easy with your presentation but I to find this matter to be
actually something that I believe I’d by no means understand.

It seems too complicated and very huge for me. I’m taking a look ahead to your next submit, I will try to get the
cling of it!

Reply
john wick December 10, 2020 - 3:29 pm

Looking forward to reading more. Great blog article. Really looking forward to read more. Maura Mauricio Peltz

Reply

Leave a Comment