This article describes how to install Ansible but not Ansible Tower. Refer to Install Ansible Tower on Linux if you also want Tower.
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 : 188.8.131.52 Release : 2.el7 Size : 38 M Repo : installed From repo : extras Summary : SSH-based configuration management, deployment, and task execution system URL : http://ansible.com 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 . . . ansible 184.108.40.206 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)]