Install Ansible Tower on RHEL 9

Install Ansible Tower on RHEL 9

Learn how to install Ansible Tower on RHEL 9 with this comprehensive step-by-step guide. Covering prerequisites, system requirements, and post-installation tasks, this resource is perfect for IT professionals looking to enhance automation capabilities.

Table of Contents

Red Hat Ansible Tower was rebranded as Red Hat Automation Controller in October 2021. This change was part of a broader rebranding of Red Hat’s automation portfolio, aligning it with the Red Hat Ansible Automation Platform. The rebranding aimed to emphasize the comprehensive capabilities of the platform for managing automation across various environments.

Introduction

Ansible Tower is the enterprise version of Ansible, providing a powerful platform for managing and automating IT tasks in complex environments. With its user-friendly web interface, role-based access control, and scheduling capabilities, Ansible Tower makes it easier to streamline operations. In this guide, we will walk you through the entire process of installing Ansible Tower on RHEL 9, ensuring that you have all the necessary information to get started with automation effectively.

Prerequisites

Before you begin the installation process, ensure that you have the following prerequisites:

  • A Registered RHEL 9 System: A machine running Red Hat Enterprise Linux 9 with sudo privileges.
  • Internet Access: Required for downloading necessary packages.
  • Basic Command-Line Knowledge: Familiarity with the Linux command line will be beneficial.

System Requirements

It’s essential to meet the following system requirements for a smooth installation of Ansible Tower:

RequirementSpecification
CPUMinimum 4 cores
RAMMinimum 8 GB
Disk SpaceMinimum 20 GB
Operating SystemRHEL 9 or compatible variant
PythonPython 3.6 or newer
AnsibleAnsible 2.9 or newer

Make sure your system meets these requirements before proceeding with the installation.

For this demonstration, we’ve configured our RHEL 9 instance as follows:

HostnameRAMCoresIP Address/OS
tower.dev.naijalabs.net164192.168.1.10 / Red Hat Enterprise Linux release 9.4 (Plow)

Install Ansible Tower on RHEL 9: Installation Instructions

Installing Required Packages

To install Ansible Tower, you first need to install some required packages. Open your terminal and execute the following commands:

				
					sudo dnf install -y git wget python3 python3-pip
				
			
Install Ansible Tower on RHEL 9

Photo by admingeek from Infotechys

It’s also advisable to keep your system updated:

				
					sudo dnf update -y && sudo systemctl reboot
				
			

Download Ansible Tower

The next step is to download the Ansible Automation Platform setup bundle. For this demonstration, we’ll go with version 2.4.1. You can obtain the installation package from the official Red Hat Ansible Automation Platform website (You will need to log on with your Red Hat Credentials to complete this step).

Install Ansible Tower on RHEL 9

Photo by admingeek from Infotechys

Install Ansible Tower

Now that you have downloaded the installation package, you can extract and run the installer. Follow these steps:

Extract the Installation Package

				
					tar -xzvf ansible-automation-platform-setup-bundle-2.4-1-x86_64.tar.gz
				
			
				
					...omitted for brevity...
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/filters/
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/filters/meta/
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/filters/meta/runtime.yml
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/filters/plugins/
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/filters/plugins/filter/
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/filters/plugins/filter/filters.py
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/filters/plugins/test/
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/filters/plugins/test/tests.py
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/filters/FILES.json
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/filters/LICENSE
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/filters/MANIFEST.json
ansible-automation-platform-setup-bundle-2.4-1-x86_64/collections/ansible_collections/mdellweg/filters/README.md
ansible-automation-platform-setup-bundle-2.4-1-x86_64/group_vars/
ansible-automation-platform-setup-bundle-2.4-1-x86_64/group_vars/all
ansible-automation-platform-setup-bundle-2.4-1-x86_64/inventory
ansible-automation-platform-setup-bundle-2.4-1-x86_64/setup.sh
ansible-automation-platform-setup-bundle-2.4-1-x86_64/README.md
				
			

Navigate to the Setup Directory

				
					cd ansible-automation-platform-setup-bundle-2.4-1-x86_64
				
			

Configure the Inventory File

The inventory file contains essential configuration settings for your Ansible Tower instance. Open it using your preferred text editor:

				
					vim inventory
				
			

Now make the following changes (Under [automationcontroller]):

				
					[automationcontroller]
tower.dev.naijalabs.net ansible_connection=local
				
			

Replace tower.dev.naijalabs.net with your the actual fully-qualified domain name (FQDN) of your RHEL 9 instance.

  • tower.dev.naijalabs.net is the hostname or address of the automation controller.
  • ansible_connection=local specifies that Ansible should use the local connection type, meaning it will execute tasks on the local machine where the playbook is running, rather than connecting to a remote host.
				
					[all:vars]
admin_password='Enter_Your_Password'

pg_host=''
pg_port=5432

pg_database='awx'
pg_username='awx'
pg_password='Enter_Your_Password'
pg_sslmode='prefer'  # set to 'verify-full' for client-side enforced SSL

				
			

Under the [all:vars] section, specify the password for both the admin user and the PostgreSQL database.

				
					[automationcontroller]
tower.dev.naijalabs.net ansible_connection=local
				
			

Optional: If you want the Automation Controller to pull images from the Hub Registry your can provide your Red Hat Credentials in the Container Registry Section.

				
					registry_url='registry.redhat.io'
registry_username='Your Red_Hat_Username'
registry_password='Your_Red_Hat_Password'
				
			

Provide an admin password for the Automation Hub Configuration section:

				
					# Automation Hub Configuration
#

automationhub_admin_password='Enter_Your_Password'

automationhub_pg_host=''
automationhub_pg_port=5432

automationhub_pg_database='automationhub'
automationhub_pg_username='automationhub'
automationhub_pg_password=''
automationhub_pg_sslmode='prefer'
				
			

Repeat the same step for the Automation EDA Controller Configuration section:

				
					# Automation EDA Controller Configuration
#

automationedacontroller_admin_password='Enter_Your_Password'

automationedacontroller_pg_host=''
automationedacontroller_pg_port=5432

automationedacontroller_pg_database='automationedacontroller'
automationedacontroller_pg_username='automationedacontroller'
automationedacontroller_pg_password=''

				
			

There are additional configuration changes that can be made to the inventory file, but for now, we’ll leave it as is. With the changes we’ve already made, you should be able to successfully install a standalone Ansible Tower or Ansible Automation Platform. ***Be sure to replace Enter_Your_Password with a strong, secure password and store in a safe place or password database***

Update deprecated yaml files

🛑Important Note: The ansible.builtin.include module has been removed. Use include_tasks or import_tasks instead. Update your playbooks as this feature was removed after May 16, 2023. Open the following files with your preferred text editor and change include: to include_tasks:

				
					vim collections/ansible_collections/ansible/automation_platform_installer/roles/postgres/tasks/main.yml
				
			
				
					vim collections/ansible_collections/ansible/automation_platform_installer/roles/packages_el/tasks/main.yml
				
			
				
					vim collections/ansible_collections/ansible/automation_platform_installer/roles/redis/tasks/main.yml
				
			
				
					vim collections/ansible_collections/ansible/automation_platform_installer/roles/rsyslog/tasks/main.yml
				
			
				
					vim collections/ansible_collections/ansible/automation_platform_installer/roles/supervisor/tasks/main.yml
				
			

Run the Installation Script

With the inventory file configured and the YAML files updated, we’re now ready to execute the installation script:

				
					sudo ./setup.sh
				
			

The installation will take several minutes to complete, as over 300 tasks will be executed during this process. Feel free to grab a coffee or stretch your legs while you wait! 😊

Completed Ansible Roles for Ansible Automation Platform

Photo by admingeek from Infotechys

Accessing the Ansible Automation Platform (Ansible Tower)

Upon a successfully run of the installation script, enter the following URL in your preferred browser: (https://<your_server_ip> or <FQDN>)

Ansible Automation Platform Web UI

Photo by admingeek from Infotechys

Log on with username admin and the password you provided earlier (Configure the Inventory File Section).

Install Ansible Tower on RHEL9: Welcome Page for Initial Setup

Photo by admingeek from Infotechys

Upon logging in, please follow these steps:

  1. Subscribe using your Red Hat account credentials.
  2. Review the User and Automation Analytics page.
  3. Accept the End User License Agreement.

After completing these steps, you will be redirected to the Ansible Automation Dashboard.

Ansible Automation Platform: Dashboard

Photo by admingeek from Infotechys

Congratulations! You’ve successfully installed the Ansible Automation Platform (formerly Ansible Tower). This is just the beginning of what it can do. For more information and guidance on getting started, please consult the official documentation page.

Conclusion

Ansible Tower, now known as Ansible Automation Platform, provides a powerful and scalable solution for automating IT tasks in enterprise environments. By following this guide, you should now have a fully functional installation of Ansible Tower on RHEL 9, ready to streamline and simplify your automation processes. With its user-friendly interface and advanced features, Ansible Tower will improve your workflow, boost efficiency, and make managing your infrastructure easier than ever.

Did you find this article useful? Your feedback is invaluable to us! Please feel free to share your thoughts in the comments section below and share this post!

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *