FreeKB - Install Ansible on Linux
Ansible - Install Ansible on Linux

This article describes how to install Ansible but not Ansible Tower. Refer to Install Ansible Tower on Linux if you also want Tower.


  • Linux OS - The system that Ansible is installed on is known as the control node. Windows is not supported for the control node. Instead, Ansible must be installed on a Linux distribution.
  • Python - The control node must have Python version 2.7 or higher or Python version 3.5 or higher installed. The python --version command can be used to determine if Python is installed and the version that is installed. If Python is not installed, the installation of Ansible will also install Python.


On a Red Hat distribution, the yum install command can be used to install Ansible.

yum install ansible


Note that Ansible does not create a daemon, thus the systemctl command will not be used. Instead, Ansible uses SSH to manage remote systems (or a different networking protocol could be used). If the install was successful, the /etc/ansible directory should contain the following.

-rw-r--r--. 1 root root 19179 Jan 29  2018 ansible.cfg
-rw-r--r--. 1 root root  1016 Jan 29  2018 hosts
drwxr-xr-x. 2 root root     6 Jan 29  2018 roles


The yum info command should return the following.

Installed Packages
Name        : ansible
Arch        : noarch
Version     :
Release     : 2.el7
Size        : 38 M
Repo        : installed
From repo   : extras
Summary     : SSH-based configuration management, deployment, and task execution system
URL         :
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.


Additionally, the ansible --version command should return output, like this.

ansible --version
. . .
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible
  python version = 2.7.5 (default, Aug  7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter d1bf5 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |