Installing Ansible on Centos 7

Ansible is a configuration managment tool used to manage servers and other devices.

This guide will help you install Ansible on a Centos 7 server. This will be your control node in your Ansible infrastructure. It is assumed that you already have a working Centos 7 server that is connected to the internet.

Requirements

The control node must have Python 2 (version 2.7) or Python 3 (version 3.5 or higher) installed. It is recommended that the control node is located “near” the managed nodes. The “near” is classified by network location and latency.

Install Ansible

The first step is choosing the version you want to install. There are a few versions you can install depending on your needs and preferred way to update.

  • OS package manager
  • RPM install
  • Python package manager
  • Compile from source

Once you have chosen the version that is right, you can follow along in this article to install Ansible in any of those methods. The next step is gaining access to the server that will be the control node. You can SSH into the server or use the console. You will need to perform this task now.

ssh root@centos7
root@centos7's password:
[root@centos7 ~]#

OS package manager

[root@centos7 ~]# sudo yum install ansible

RPM install (EPEL)

[root@centos7 ~]# sudo yum install epel-release
[root@centos7 ~]# sudo yum install ansible

Python package manager

[root@centos7 ~]# sudo yum install epel-release
[root@centos7 ~]# sudo yum install python2-pip
[root@centos7 ~]# pip install ansible

Installing Ansible is easy with the following steps. There is not any right or wrong way to install Ansible. Just get to using it now.

Leave a Reply