Swiftorial Logo
Home
Swift Lessons
Matchups
CodeSnaps
Tutorials
Career
Resources

Setting Up Ansible Tower

1. Introduction

Ansible Tower is a powerful web-based interface for Ansible, providing a centralized platform to manage your IT infrastructure. In this tutorial, we will go through the steps required to set up Ansible Tower from scratch.

2. Prerequisites

Before setting up Ansible Tower, ensure you have the following prerequisites:

  • A Linux server (RHEL/CentOS 7 or 8)
  • Root or sudo access to the server
  • Internet access to download necessary packages

3. Installing Ansible

First, we need to install Ansible on the server. Use the following commands:

sudo yum install -y epel-release
sudo yum install -y ansible

Verify the installation by checking the Ansible version:

ansible --version
ansible 2.9.13
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.8 (default, Aug 18 2020, 08:33:21) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]

4. Downloading and Installing Ansible Tower

Next, we need to download and install Ansible Tower. Follow these steps:

wget https://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-latest.tar.gz
tar xvzf ansible-tower-setup-latest.tar.gz
cd ansible-tower-setup

5. Configuring Ansible Tower

Inside the setup directory, you will find a file named inventory. Open this file with a text editor to configure the necessary settings:

vi inventory

Update the inventory file with the following details:

[tower]
localhost ansible_connection=local

[database]
[external_database]

[all:vars]
admin_password='YourAdminPassword'
pg_host='' # Leave blank if using internal database
pg_port=''
pg_database='awx'
pg_username='awx'
pg_password='YourPostgresPassword'
rabbitmq_password='YourRabbitMQPassword'
rabbitmq_erlang_cookie='' # Can be left blank
redis_password='YourRedisPassword'

6. Running the Ansible Tower Setup

Once the configuration is complete, run the setup script to install Ansible Tower:

sudo ./setup.sh

This process may take a few minutes. Upon successful installation, you will see a completion message.

7. Accessing Ansible Tower

After the installation is complete, you can access Ansible Tower using a web browser. Navigate to the following URL:

http://

Log in with the default credentials:

  • Username: admin
  • Password: The password you set in the inventory file

8. Conclusion

In this tutorial, we covered the steps to set up Ansible Tower on a Linux server. With Ansible Tower, you can manage your IT infrastructure more efficiently using its powerful features. Explore the web interface to familiarize yourself with its capabilities.