Learn how to install and configure Ansible AWX on AlmaLinux 9 with this step-by-step guide. Set up automation with Docker/Podman, PostgreSQL, and Ansible, troubleshoot common issues, and optimize AWX for IT automation. Get started today! #centlinux #linux #ansible
Table of Contents
Effortless IT Automation: Installing Ansible AWX on AlmaLinux 9
In today’s fast-paced IT landscape, automation is more than just a luxury—it’s a necessity. That’s where Ansible AWX comes in. As the upstream, open-source project behind Red Hat Ansible Automation Platform (formerly Ansible Tower), AWX provides a powerful web-based interface, REST API, and task engine for managing and automating IT operations at scale. It offers the same core functionalities as Ansible Tower—without the licensing fees—making it an excellent choice for teams looking to implement enterprise-grade automation on a budget.
So, why choose AWX? Whether you’re managing cloud infrastructure, deploying applications, or orchestrating complex workflows, AWX simplifies automation with role-based access control, job scheduling, and centralized logging. It brings all the power of Ansible to a graphical dashboard, reducing complexity and enhancing collaboration among teams.
And when it comes to the best operating system for hosting AWX, AlmaLinux 9 stands out. As a robust, enterprise-grade RHEL-compatible distribution, AlmaLinux offers stability, long-term support, and security—all essential for running automation workloads in production environments. Its lightweight footprint and compatibility with modern containerization tools like Podman and Docker make it an ideal choice for deploying AWX.
In this guide, we’ll walk you through the step-by-step process of installing Ansible AWX on AlmaLinux 9. By the end, you’ll have a fully functional AWX instance, ready to streamline your IT automation workflows. Whether you’re a seasoned sysadmin or just starting with Ansible, this tutorial will ensure a smooth installation and configuration process. Let’s dive in!

Prerequisites for Installing Ansible AWX on AlmaLinux 9
Before installing Ansible AWX on AlmaLinux 9, ensure your system meets the necessary requirements and is properly configured. This section covers hardware requirements, necessary software, user permissions, and security settings to prepare your system for a smooth installation.
1. Minimum System Requirements
Ansible AWX is resource-intensive, especially when managing multiple automation jobs. The following are the recommended minimum requirements:
- CPU: 2+ vCPUs (4+ recommended for production)
- RAM: 4GB (8GB+ recommended for better performance)
- Disk Space: 20GB+ (for AWX, PostgreSQL, and logs)
- OS: AlmaLinux 9 (fully updated)
Check your system specifications using:
lscpu | grep "Model name" # Check CPU model
free -h # Check available RAM
df -h / # Check available disk space
2. Required Software
Several essential packages must be installed before deploying AWX.
Python 3
AlmaLinux 9 comes with Python 3, but you can verify and install it if needed:
python3 --version
sudo dnf install -y python3 python3-pip
Podman or Docker
AWX runs in containers, so you need Podman (default) or Docker.
To install Podman (recommended for AlmaLinux 9):
sudo dnf install -y podman
podman --version
To install Docker (optional alternative):
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io
sudo systemctl enable --now docker
docker --version
PostgreSQL (Database for AWX)
AWX requires a PostgreSQL database (version 13 or later). Install and enable it:
sudo dnf install -y postgresql-server postgresql-contrib
sudo postgresql-setup --initdb
sudo systemctl enable --now postgresql
psql --version
3. User Permissions
- You must have root or sudo privileges to install and configure AWX.
- Verify sudo access with:
sudo whoami
If the output is root, you have the necessary permissions.
4. Firewall and SELinux Settings
Configure Firewall Rules
If you have firewalld enabled, allow AWX-related ports:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-port=5432/tcp # PostgreSQL
sudo firewall-cmd --reload
Adjust SELinux (If Enforcing Mode is Enabled)
For smooth installation, set SELinux to permissive mode temporarily:
sudo setenforce 0
sudo sed -i 's/^SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
Check the current SELinux mode:
sestatus
5. Verify System Compatibility
Before proceeding with installation, ensure everything is set up correctly:
# Check AlmaLinux version
cat /etc/os-release | grep "VERSION_ID"
# Verify Podman or Docker installation
podman --version || docker --version
# Confirm PostgreSQL is running
sudo systemctl status postgresql | grep "active (running)"
# Check firewall and SELinux status
sudo firewall-cmd --list-all
sestatus
Once all prerequisites are met, you are ready to install and configure Ansible AWX on AlmaLinux 9.
Recommended Training: Dive Into Ansible – Beginner to Expert in Ansible – DevOps

Preparing AlmaLinux 9 for Ansible AWX Installation
Before installing Ansible AWX on AlmaLinux 9, you need to prepare the system by updating packages, installing dependencies, creating a dedicated AWX user, and configuring security settings. Follow this step-by-step guide to ensure a smooth setup.
Step 1: Update the System
Keeping your system up to date ensures security patches and the latest package versions are installed.
sudo dnf update -y
✔ Why? This updates all installed packages to their latest stable versions, reducing compatibility issues.
After updating, reboot the system to apply kernel updates (if any):
sudo reboot
Step 2: Install Essential Dependencies
Install EPEL Repository
EPEL (Extra Packages for Enterprise Linux) provides additional useful packages.
sudo dnf install epel-release -y
✔ Why? AWX and its dependencies may require certain packages that are not available in AlmaLinux’s default repositories.
Install Git and Required Tools
Git is required to clone the AWX installation files.
sudo dnf install git -y
✔ Why? AWX is hosted on GitHub, and we need Git to fetch its source code.
Verify installation:
git --version
Amazon Fire HD 10 Kids Pro tablet (newest model) ages 6-12. Bright 10.1″ HD screen, includes ad-free content, robust parental controls, 13-hr battery and slim case for older kids, 32 GB, Happy Day
$189.99 (as of April 23, 2025 16:07 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Step 3: Create a Dedicated AWX User
For security and best practices, AWX should run under a non-root user with appropriate permissions.
sudo useradd -m -d /opt/awx -s /bin/bash awx
✔ Why? Running applications under a dedicated user prevents unintended system-wide modifications.
Grant sudo privileges to the awx user:
echo "awx ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/awx
✔ Why? This allows the AWX user to execute necessary administrative commands without a password prompt.
Switch to the AWX user:
sudo su - awx
✔ Why? All AWX-related installations and configurations should be done under this user.
Step 4: Configure Firewall Rules
To allow AWX access, open necessary ports in firewalld:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-port=5432/tcp # PostgreSQL
sudo firewall-cmd --reload
✔ Why?
- HTTP (80) & HTTPS (443) → Required for AWX’s web UI.
- PostgreSQL (5432) → Required if hosting the AWX database on the same server.
Verify active firewall rules:
sudo firewall-cmd --list-all
Step 5: Adjust SELinux (If Enforcing Mode is Enabled)
AWX runs in containers, which may require adjustments to SELinux policies. To prevent installation issues, set SELinux to permissive mode temporarily:
sudo setenforce 0
Make it permanent by editing the SELinux config file:
sudo sed -i 's/^SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
✔ Why? Enforcing mode may block AWX-related container processes. You can later create custom SELinux policies for AWX.
Check the current SELinux status:
sestatus
Final Verification
Before proceeding to install AWX, confirm that everything is set up correctly:
# Check system version
cat /etc/os-release | grep "VERSION_ID"
# Verify user switch (should return 'awx')
whoami
# Confirm Git installation
git --version
# Check firewall and SELinux status
sudo firewall-cmd --list-all
sestatus
🎉 Your AlmaLinux 9 system is now fully prepared for Ansible AWX installation! You can now proceed with installing and configuring AWX in the next steps.
Installing and Configuring Docker or Podman on AlmaLinux 9
Ansible AWX runs inside containers, so you need a container runtime to deploy it. AlmaLinux 9 supports Podman (the recommended default) and Docker (a popular alternative). This guide helps you choose the right tool and walks you through installing and verifying the container runtime.
Choosing Between Podman and Docker
Feature | Podman 🟢 (Recommended) | Docker 🔵 |
---|---|---|
Rootless Execution | Yes (default) ✅ | No (requires extra setup) ❌ |
Service Mode | Runs containers without a daemon ✅ | Uses dockerd service ❌ |
Compatibility with Docker CLI | Yes ✅ | Native support ✅ |
Security | More secure (no root privileges needed) ✅ | Runs as root by default ❌ |
System Resource Usage | Lighter ✅ | Slightly heavier ❌ |
Orchestration Support | Works with Kubernetes/OpenShift ✅ | Native Kubernetes support ✅ |
Persistent Daemon | No (per container) ❌ | Yes (via dockerd ) ✅ |
💡 Best Choice: If security and rootless execution are important, Podman is the better choice for AlmaLinux 9. However, if you need a traditional Docker setup (for compatibility with existing tools), you can install Docker instead.
Installing Podman (Recommended for AlmaLinux 9)
Step 1: Install Podman and Docker Compose
sudo dnf install -y podman docker-compose
✔ Why?
podman
→ Installs the Podman container engine.docker-compose
→ Ensures compatibility with Docker Compose files.
Step 2: Verify the Installation
Check the installed version:
podman --version
Step 3: Run a Test Container
Run an Alpine Linux test container:
podman run --rm -it alpine sh
✔ Explanation:
run
→ Runs a container.--rm
→ Removes the container after it stops.-it
→ Interactive mode (connects you to the container).alpine
→ Lightweight Linux image.sh
→ Starts a shell inside the container.
To exit, type:
exit
FFJ Wireless Gaming Mouse, 24000 DPI, Tri-Mode 2.4G/USB-C/Bluetooth 5.3 Gaming Mouse Wireless, RGB Programmable Mouse Gamer, 75Hrs Battery Life, Rechargeable Gaming Mice for PC, Mac, PS5, Xbox – Black
$19.99 (as of April 24, 2025 16:15 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Installing Docker (Alternative Choice)
If you prefer Docker, follow these steps instead.
Step 1: Install Docker
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-compose
✔ Why?
dnf-plugins-core
→ Enables additional repository management features.config-manager
→ Adds the official Docker CE (Community Edition) repo.docker-ce
→ Installs Docker Engine.docker-ce-cli
→ Installs the Docker CLI tools.containerd.io
→ Required container runtime.docker-compose
→ Installs Docker Compose for multi-container applications.
Step 2: Enable and Start Docker
sudo systemctl enable --now docker
✔ Why?
enable
→ Ensures Docker starts on boot.now
→ Starts Docker immediately.
Verify Docker is running:
sudo systemctl status docker
Step 3: Run a Test Container
sudo docker run --rm -it alpine sh
✔ Same as Podman, but requires sudo (unless configured for rootless mode).
Exit the container with:
exit
Final Verification
Check if the container runtime is working properly:
- For Podman:
podman ps
- For Docker:
sudo docker ps
Expected output: An empty list (since no containers are running).
Conclusion
- Use Podman if you prefer better security, rootless execution, and native compatibility with RHEL-based distros like AlmaLinux 9.
- Use Docker if you need a traditional daemon-based container system or work with tools that specifically require Docker.
After installing your preferred container runtime, you are now ready to install and configure Ansible AWX!
Installing Ansible and AWX CLI on AlmaLinux 9
To manage and interact with Ansible AWX, you need to install:
✅ Ansible → The automation engine used by AWX to run playbooks.
✅ AWX CLI (Ansible Tower CLI) → A command-line tool to manage AWX from the terminal.
Follow this step-by-step guide to install both on AlmaLinux 9.
Step 1: Install Ansible
Ansible is available in AlmaLinux’s official repositories. Install it using:
sudo dnf install ansible -y
✔ Explanation:
dnf install ansible -y
→ Installs Ansible without requiring confirmation.
Step 2: Verify Ansible Installation
Check the installed version:
ansible --version
Expected output (example):
ansible [core 2.14.0]
config file = /etc/ansible/ansible.cfg
python version = 3.9
✔ Why? Ensures that Ansible is installed and ready for use.
Step 3: Install AWX CLI (Ansible Tower CLI)
AWX CLI (formerly Ansible Tower CLI) allows you to interact with AWX from the command line.
Install AWX CLI using pip
pip3 install ansible-tower-cli --user
✔ Explanation:
pip3 install ansible-tower-cli --user
→ Installs AWX CLI for the current user without requiring root access.
Step 4: Verify AWX CLI Installation
Run the following command to check if AWX CLI is installed:
awx --help
Expected output: A list of available AWX CLI commands.
How Ansible and AWX CLI Work Together
Component | Purpose | Interaction |
---|---|---|
Ansible | Automation engine for running playbooks | AWX executes Ansible playbooks in containers |
AWX | Web-based automation controller | Uses Ansible to manage IT infrastructure |
AWX CLI | Command-line tool for AWX | Manages AWX tasks, inventories, and jobs from the terminal |
🎯 Now that Ansible and AWX CLI are installed, you can proceed with deploying Ansible AWX on AlmaLinux 9!
Downloading and Configuring the AWX Installer on AlmaLinux 9
Now that you have prepared your AlmaLinux 9 system, installed Ansible, and set up a container runtime, it’s time to download and configure the AWX installer. This guide covers:
✅ Cloning the AWX installer from GitHub
✅ Modifying the inventory file for database and authentication settings
✅ Customizing ports and other parameters
Step 1: Clone the AWX Installer from GitHub
The AWX installer is hosted on GitHub. Clone it using Git:
git clone https://github.com/ansible/awx.git
✔ Why? This downloads the latest AWX source code, including the installer and deployment scripts.
Navigate to the installer directory:
cd awx/installer
✔ Why? The installer/ directory contains the files needed to deploy AWX using Ansible.
Step 2: Modify the AWX Inventory File
The inventory file contains essential settings for AWX deployment, including database credentials, admin login details, and ports.
Open the inventory file in a text editor:
nano inventory
Key Parameters to Modify
🔹 PostgreSQL Database Configuration
Modify the following lines to set up PostgreSQL (used by AWX for data storage):
postgres_data_dir="/var/lib/pgdocker"
pg_username="awx"
pg_password="StrongDBPassword123"
pg_database="awx"
pg_port="5432"
✔ Best Practices:
- Use a strong database password.
- Change the data directory if needed for persistent storage.
🔹 Admin Credentials for AWX
Set the admin username and password for the AWX web interface:
admin_user="admin"
admin_password="SecureAWXPass!"
✔ Tip: Use a strong password to secure AWX access.
🔹 Container Runtime Selection
By default, the installer uses Docker. If you’re using Podman, modify this line:
awx_task_hostname="localhost"
docker_compose_use_podman=True
✔ Why? This ensures AWX runs correctly in a Podman environment.
🔹 Port Configuration
By default, AWX runs on port 80. To change it (e.g., to 8080):
awx_web_port="8080"
✔ Why? If another service is using port 80, change it to avoid conflicts.
Step 3: Save and Exit
After modifying the inventory file:
1️⃣ Press CTRL + X to exit.
2️⃣ Press Y to save changes.
3️⃣ Press Enter to confirm.
✅ The AWX installer is now configured. Next, you’ll run the installer to deploy AWX on AlmaLinux 9! 🚀
Deploying AWX Using Ansible on AlmaLinux 9
Now that the AWX installer is configured, it’s time to deploy AWX using Ansible. This guide walks you through running the playbook, monitoring logs, and troubleshooting common errors.
Step 1: Run the Ansible Playbook
Navigate to the installer directory:
cd ~/awx/installer
Run the Ansible playbook to start the installation:
ansible-playbook -i inventory install.yml
✔ What happens during execution?
- Ansible connects to the local system and prepares the environment.
- PostgreSQL is deployed as the AWX database.
- Containers for AWX services (web, task, Redis) are created and started.
- Nginx is configured as a reverse proxy for AWX.
💡 Tip: If you’re using Podman instead of Docker, ensure you set docker_compose_use_podman=True
in the inventory file.
Step 2: Monitor the Installation Progress
The playbook execution may take several minutes. To check the logs:
journalctl -u awx --no-pager --lines=50
✔ Why? This displays the latest 50 log lines from the AWX service.
To monitor logs in real time:
tail -f /var/log/messages
✔ Why? This continuously outputs system logs related to AWX deployment.
Step 3: Verify AWX Deployment
Once the playbook completes successfully:
1️⃣ Check if the AWX containers are running:
- For Podman:
podman ps
- For Docker:
sudo docker ps
2️⃣ Open a web browser and access AWX:
http://<server-ip>:8080
(Replace 8080
with your AWX port if you changed it in the inventory file.)
3️⃣ Log in using the admin credentials set in the inventory file:
- Username:
admin
- Password:
SecureAWXPass!
(or your configured password)
Step 4: Troubleshooting Common Installation Errors
❌ Issue: “ERROR! the playbook execution failed”
✔ Fix: Check the Ansible logs:
less /var/log/ansible.log
Look for missing dependencies or permission issues.
❌ Issue: “Failed to start PostgreSQL container”
✔ Fix: Verify PostgreSQL is running:
sudo systemctl status postgresql
If it’s not running, start it:
sudo systemctl start postgresql
❌ Issue: “Error connecting to AWX Web UI”
✔ Fix: Ensure the AWX service is running:
podman ps # If using Podman
sudo docker ps # If using Docker
If the container is down, restart it:
podman start <container-id> # Podman
sudo docker start <container-id> # Docker
✔ Fix: Check the firewall rules:
sudo firewall-cmd --list-ports
If port 8080 (or your configured port) is not listed, add it:
sudo firewall-cmd --permanent --add-port=8080/tcp
sudo firewall-cmd --reload
🎉 AWX is now deployed! You can start creating projects, inventories, and automation jobs in the AWX web UI.
Accessing the Ansible AWX Web Interface on AlmaLinux 9
Now that AWX is successfully deployed, it’s time to access the web interface. This guide covers:
✅ Retrieving the admin password from logs
✅ Finding the AWX server IP address
✅ Logging in to the AWX dashboard
✅ Security best practices after the first login
Step 1: Retrieve the Admin Password
If you didn’t manually set the admin password in the inventory file before installation, AWX generates one automatically. To retrieve it, check the logs:
sudo journalctl -u awx --no-pager | grep "awx admin password"
Alternatively, if using Podman or Docker, check the container logs:
- For Podman:
podman logs <awx-task-container-id> | grep "admin_password"
- For Docker:
sudo docker logs <awx-task-container-id> | grep "admin_password"
🔹 Tip: Replace <awx-task-container-id>
with the actual AWX task container ID, which you can find by running:
podman ps # For Podman
sudo docker ps # For Docker
Step 2: Determine the AWX Server IP Address
To access AWX, you need the server’s IP address. Run:
ip a | grep inet
Look for the primary IP address (often associated with eth0
or ens192
).
🔹 If accessing remotely: Ensure the AWX server has a public or private IP that’s reachable from your network.
Step 3: Access the AWX Web Interface
Using a Web Browser
1️⃣ Open your web browser and enter the following URL:
http://<server-ip>:8080
(Replace 8080
with your configured AWX port if you changed it in the inventory file.)
2️⃣ When prompted, enter the admin username and password:
- Username:
admin
- Password: Retrieved from Step 1
Read Also: How to install Ansible AWX on CentOS 7
Step 4: Overview of the AWX Dashboard
After logging in, you’ll see the AWX dashboard, which includes:
- Projects → Stores Ansible playbooks.
- Inventories → Manages hosts and groups.
- Templates → Defines automation jobs.
- Schedules → Automates recurring tasks.
- Users & Teams → Manages user roles and permissions.
Tip: Click on Jobs to monitor running and completed automation tasks.
Step 5: Security Best Practices Post-Login
🔐 1. Change the Default Admin Password
Go to:Settings
→ Users
→ Select admin
→ Change password.
🔐 2. Enable HTTPS (SSL/TLS) for Secure Access
Use an Nginx or Apache reverse proxy with an SSL certificate (e.g., Let’s Encrypt).
🔐 3. Restrict Access with a Firewall
Only allow trusted IPs to access AWX:
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="YOUR_IP" port port=8080 protocol=tcp accept'
sudo firewall-cmd --reload
🔐 4. Create Additional Users with Limited Permissions
Go to Users
→ Create New User
and assign roles based on responsibilities.
🎉 AWX is now ready for automation! You can start adding inventories, playbooks, and job templates to manage IT infrastructure efficiently.
Bash Pocket Reference: Help for Power Users and Sys Admins
$17.60 (as of April 24, 2025 16:08 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Post-Installation Guide: Configuring Ansible AWX on AlmaLinux 9
After successfully installing Ansible AWX, the next step is to configure it for automation workflows. This guide covers:
- Creating and managing users with Role-Based Access Control (RBAC)
- Adding an inventory and configuring credentials
- Creating projects and job templates
- Security hardening best practices
1. Managing Users & Roles in AWX (RBAC)
Step 1: Create a New User
1️⃣ Log in to AWX Web UI (http://<server-ip>:8080
).
2️⃣ Navigate to Access → Users → Add (+).
3️⃣ Enter:
- Username (e.g.,
devops_user
) - Email (optional)
- Password
Step 2: Assign Role-Based Access
AWX uses RBAC to control permissions. Assign roles based on user responsibilities:
Role | Access Level | Use Case |
---|---|---|
System Administrator | Full access to AWX | IT Managers, DevOps Engineers |
Auditor | Read-only access | Compliance & Security Teams |
Project Admin | Manages playbooks | Lead DevOps Engineers |
Job Executor | Runs job templates | Junior Sysadmins, Developers |
1️⃣ Go to Users → Select devops_user
2️⃣ Click Roles → Add Role
3️⃣ Choose a role (e.g., Job Executor) and click Save
Real-World Example: Assign developers the ability to run playbooks without modifying configurations.
2. Adding an Inventory & Setting Up Credentials
Step 1: Create an Inventory
Inventories define the hosts AWX manages.
1️⃣ Go to Resources → Inventories → Add (+)
2️⃣ Enter:
- Name (e.g.,
Production Servers
) - Organization (Default or Custom)
Step 2: Add Hosts to Inventory
1️⃣ Select the newly created Inventory
2️⃣ Click Hosts → Add (+)
3️⃣ Enter:
- Hostname/IP (e.g.,
192.168.1.100
) - Description (e.g.,
Web Server
)
Step 3: Configure SSH Credentials
1️⃣ Go to Resources → Credentials → Add (+)
2️⃣ Enter:
- Name:
SSH Access
- Credential Type: Machine
- Username:
ansible
- Private Key (Upload SSH key if needed)
3️⃣ Assign the SSH Credential to your Inventory.
🔹 Real-World Example: If managing AWS EC2 instances, create AWS credentials instead.
3. Creating Projects & Job Templates
Step 1: Create a Project (GitHub/GitLab Integration)
Projects store Ansible playbooks.
1️⃣ Go to Resources → Projects → Add (+)
2️⃣ Enter:
- Name:
Server Automation
- Source Control Type: Git
- Repository URL:
https://github.com/example/ansible-playbooks.git
3️⃣ Click Save → Sync to fetch playbooks.
Real-World Example: Automate Apache installation via a Git-based repository.
Step 2: Create a Job Template
1️⃣ Go to Resources → Templates → Add (+) Job Template
2️⃣ Enter:
- Name:
Deploy Web Server
- Job Type: Run
- Inventory:
Production Servers
- Project:
Server Automation
- Playbook:
install_apache.yml
- Credentials:
SSH Access
3️⃣ Click Save → Launch 🚀
Real-World Example: Deploy an Apache web server on a fleet of servers with a single click!
4. Security Hardening Best Practices
🔐 1. Restrict Web UI Access
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="YOUR_IP" port port=8080 protocol=tcp accept'
sudo firewall-cmd --reload
🔐 2. Enable HTTPS with SSL
Set up Nginx as a reverse proxy with a Let’s Encrypt SSL certificate.
🔐 3. Use Role-Based Access Control (RBAC)
- Limit access to sensitive job templates.
- Assign API tokens for automation scripts.
🔐 4. Enable Logging & Audit Trails
Go to Settings → System → Enable Logging for compliance monitoring.
🔐 5. Regularly Update AWX & Dependencies
sudo dnf update -y
🎉 AWX is now fully configured! You can start automating IT infrastructure, deploying applications, and managing configurations—all from a centralized web interface.
Troubleshooting Ansible AWX on AlmaLinux 9
Even with a successful installation, you may encounter issues while running Ansible AWX. This guide covers common AWX troubleshooting scenarios, including:
- Fixing installation failures
- Resolving database connection issues
- Debugging authentication and login failures
- Finding and interpreting AWX logs
1. Fixing Installation Failures
Check System Logs for Errors
If the AWX installation fails, check the system logs:
sudo journalctl -xe
Look for AWX service errors, missing dependencies, or permission issues.
Check AWX Installer Logs
If the Ansible playbook fails, check the output logs:
cd ~/awx/installer
ansible-playbook -i inventory install.yml -vvv
✔ What to look for?
- Permission Denied → Check if you are using sudo/root.
- Timeout Errors → Verify firewall and SELinux settings.
- Dependency Issues → Ensure Python, Podman, and PostgreSQL are installed correctly.
Check Docker or Podman Logs
- For Docker:
sudo docker logs <container_id>
- For Podman:
podman logs <container_id>
✔ Example Fix: If awx-task
container keeps restarting, inspect logs for missing Python dependencies and install them:
pip3 install --upgrade pip
pip3 install -r ~/awx/requirements.txt
2. Resolving Database Connection Issues
If AWX cannot connect to PostgreSQL, you might see errors like:
django.db.utils.OperationalError: could not connect to server
Step 1: Verify PostgreSQL is Running
sudo systemctl status postgresql
✔ Fix: If PostgreSQL is not running, start it:
sudo systemctl start postgresql
sudo systemctl enable postgresql
Step 2: Check Database Connection from AWX Container
- For Docker:
sudo docker exec -it <awx-task-container-id> psql -U awx -d awx
- For Podman:
podman exec -it <awx-task-container-id> psql -U awx -d awx
✔ Fix: If the connection fails, ensure DATABASE_USER
, DATABASE_NAME
, and DATABASE_PASSWORD
are correctly set in the inventory file (~/awx/installer/inventory
).
Step 3: Check Firewall & SELinux
sudo firewall-cmd --list-ports
✔ Fix: Open port 5432 for PostgreSQL if needed:
sudo firewall-cmd --permanent --add-port=5432/tcp
sudo firewall-cmd --reload
3. Debugging Authentication & Login Failures
Problem 1: Forgot Admin Password
✔ Fix: Reset it using the AWX task container:
sudo docker exec -it awx-task awx-manage changepassword admin
Or for Podman:
podman exec -it awx-task awx-manage changepassword admin
Problem 2: “Invalid Login Credentials” Error
✔ Fix: Ensure database migrations ran successfully:
sudo docker exec -it awx-task awx-manage migrate
Or for Podman:
podman exec -it awx-task awx-manage migrate
Problem 3: AWX Web UI Not Loading
✔ Fix: Restart AWX containers:
sudo docker restart <container_id>
Or
podman restart <container_id>
4. Finding & Interpreting AWX Logs
AWX logs are crucial for troubleshooting. Here’s where to find them:
AWX Service Logs
sudo journalctl -u awx --no-pager --lines=50
AWX Task Container Logs
- For Docker:
sudo docker logs awx-task --follow
- For Podman:
podman logs awx-task --follow
AWX API Logs (Web & API Errors)
sudo docker exec -it awx-task awx-manage showmigrations
Real-World Example: Debugging AWX Job Failures
If an Ansible job template fails, check job logs in the AWX Web UI:
1️⃣ Go to Jobs → Select the failed job
2️⃣ Click View Logs
3️⃣ Look for:
- SSH Connection Errors (
Permission denied
) → Verify credentials - Playbook Syntax Errors (
YAML parsing error
) → Runansible-lint
- Timeout Issues (
Host unreachable
) → Check firewall rules
5. Common AWX Errors & Fixes
Issue | Possible Cause | Solution |
---|---|---|
awx-task container keeps restarting | Missing dependencies | Run pip3 install -r requirements.txt |
403 Forbidden on Web UI | Missing permissions | Ensure admin user has correct roles |
Job fails with "Host Unreachable" | SSH issues | Verify inventory and credentials |
Playbook syntax error | YAML formatting issue | Run ansible-lint on playbooks |
Cannot connect to PostgreSQL | Service not running | Start PostgreSQL with systemctl start postgresql |
SSL certificate error | Self-signed cert issue | Install valid SSL or bypass with --insecure |
Troubleshooting AWX on AlmaLinux 9 requires log analysis, system checks, and debugging configurations. By using the right commands, you can quickly resolve most issues and keep your automation workflows running smoothly.
Final Thoughts
Congratulations! 🎉 You’ve successfully installed and configured Ansible AWX on AlmaLinux 9. With AWX up and running, you now have a powerful, web-based automation platform to manage your IT infrastructure efficiently.
Whether you need cloud optimization, server management, or automation, I provide comprehensive AWS and Linux services. Hire me on Fiverr to elevate your systems.
Quick Recap of Installation Steps
- Prepared the system (updated packages, installed dependencies).
- Installed and configured Docker/Podman for containerized deployment.
- Installed Ansible and AWX CLI to interact with AWX.
- Cloned and customized the AWX installer with database and network settings.
- Deployed AWX using Ansible and verified its web UI.
- Configured users, inventories, credentials, and job templates for automation.
- Applied security best practices to protect your AWX instance.
Best Practices for Maintaining AWX
- Keep AWX updated – Regularly check for updates to stay secure and get new features.
- Monitor logs – Use
journalctl
anddocker/podman logs
to diagnose issues proactively. - Secure AWX – Restrict web UI access, enforce role-based permissions, and enable logging.
- Optimize PostgreSQL – Tune database settings for better performance in large environments.
- Automate AWX itself – Use Ansible playbooks to back up configurations and deploy updates.
Further Learning & Resources
📖 Official Ansible AWX Documentation – https://github.com/ansible/awx
📖 Ansible Automation Guide – https://docs.ansible.com/
📖 Podman/Docker Best Practices – https://podman.io/
Next Steps: Start Automating! 🚀
Now that AWX is set up, explore automation workflows by:
- Writing playbooks for server provisioning, security updates, and deployments.
- Integrating AWX with CI/CD pipelines for DevOps efficiency.
- Managing cloud infrastructure across AWS, Azure, and Google Cloud.
Ansible AWX unlocks next-level automation, streamlining IT operations and saving valuable time. Keep experimenting, optimize your workflows, and embrace the power of automation! 💡⚡
Leave a Reply
You must be logged in to post a comment.