Installation

 

Ansible Engine Installation

Ansible can be installed directly from Red Hat Customer Portal or can be downloaded from Ansible official site and installed.
From Red Hat Customer Portal:
This is for users who are subscribed to Red Hat Customer Portal so the package can be installed directly. Required subscriptions from Red Hat Package (For Red Hat Enterprise Linux):
subscription-manager repos \
--enable rhel-7-server-rpms \
--enable rhel-7-server-extras-rpms \
--enable rhel-server-rhscl-7-rpms \
--enable rhel-7-server-ansible-2.8-rpms
yum update --advisory=RHBA-2019:1703
Ansible Engine Installation (For Red Hat Enterprise Linux):
yum install ansible
 
From Ansible official site:
Download Ansible package from: https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ 
yum install epel-release
yum install python python-devel python-pip openssl
yum install ansible

 

Ansible Tower Installation

Ansible Tower can be installed directly from Red Hat Customer Portal or can be downloaded from Ansible official site and installed. 
From Red Hat Customer Portal:
This is for users who are subscribed to Red Hat Customer Portal so the installer package can be downloaded and executed easily.
yum install ansible-tower-setup
cd /var/lib/awx/setup
Edit the Inventory file (*)
./ansible-tower-setup
 
From Ansible official site:
This is for users who are not subscribed to Red Hat Customer Portal so the zipped tarfile can be downloaded, unzipped, extracted and run.
mkdir /tmp/Ansibletar
cd /tmp/Ansibletar
Download ansible-tower-setup-latest.tar.gz from: https://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-latest.tar.gz
tar  zxvf ansible-tower-setup-latest.tar.gz
cd /Ansible/ansible-tower-setup-3.5.0-1
Create the Inventory file (*)
./setup.sh
* Inventory file is explained in next section. 

 

Ansible Engine Installation Inventory

This is a sample of Ansible Installation Inventory file. In this file localhost is specified for hosting the Tower, the admin password is set to PASSWORD, etc.
[tower]
localhost ansible_connection=local
[database]
[all:vars]
admin_password='PASSWORD'
pg_host=''
pg_port=''
pg_database='awx'
pg_username='awx'
pg_password='awx01'
rabbitmq_username=tower
rabbitmq_password='tower01'
rabbitmq_cookie=cookiemonster
# Isolated Tower nodes automatically generate an RSA key for authentication;
# To disable this behavior, set this value to false
# isolated_key_generation=true
isolated_key_generation=false

 

Uninstall Ansible Tower

Shut down Tower services by running:
ansible-tower-service stop
Uninstall ansible-tower packages:
yum remove ansible-tower\*
If you run into PREIN scriptlet error while removing ansible-tower* rpm packages execute the below command:
rpm -e --noscripts PACKAGE_NAME
where PACKAGE_NAME is name of the rpm package which ran into scriptlet error.
Uninstall Rabbit MQ:
yum -y remove rabbitmq-server
Delete Tower data/configuration files:
rm -rf /etc/tower /var/lib/{pgsql,awx,rabbitmq}
Verify that Ansible Tower components are uninstalled by checking that:
rpm -qa | grep ansible-tower
returns no results
Use:
yum erase <package-name>
to remove any remaining ansible-tower-* packages.