Ansible AWX Tower
Open-source web interface and automation engine for Ansible.
Overview
Ansible AWX is the open-source upstream project for Red Hat Ansible Tower, providing a web-based user interface, REST API, and task engine built on top of Ansible. Originally developed by Ansible Inc. (now part of Red Hat), AWX transforms command-line Ansible playbooks into a centralized automation platform with role-based access control, job scheduling, and comprehensive logging. The platform consists of awx-web for the Django-based web interface and API, awx-task for executing playbook jobs, and receptor for mesh networking between execution nodes. This stack combines AWX's automation capabilities with PostgreSQL for robust data persistence of job histories, inventories, and credentials, while Redis provides high-speed caching and task queue management for job execution coordination. The architecture enables organizations to scale their infrastructure automation beyond individual administrators running ad-hoc playbooks to enterprise-wide automation workflows. Operations teams, DevOps engineers, and platform administrators benefit from this combination when they need centralized control over Ansible automation, audit trails for compliance, and the ability to delegate specific automation tasks to team members without exposing underlying infrastructure credentials.
Key Features
- Web-based playbook editor with syntax highlighting and Git integration for version-controlled automation
- Role-based access control with team permissions and credential isolation for secure automation delegation
- Job templates with survey prompts allowing end-users to run parameterized playbooks without Ansible knowledge
- Real-time job output streaming with color-coded status indicators and detailed execution logs
- Inventory management with dynamic inventory sources from cloud providers, LDAP, and custom scripts
- Workflow visualizer for chaining multiple job templates with conditional logic and approval gates
- REST API with token authentication enabling integration with CI/CD pipelines and external tools
- Receptor mesh networking for executing jobs across distributed execution nodes and isolated networks
Common Use Cases
- 1Enterprise configuration management centralizing Ansible playbooks across multiple teams and environments
- 2Self-service infrastructure provisioning allowing developers to deploy staging environments through web forms
- 3Compliance automation with scheduled scans and remediation playbooks for security baselines
- 4Network device management for automating router, switch, and firewall configurations at scale
- 5Application deployment pipelines integrating with GitLab CI or Jenkins for automated releases
- 6Disaster recovery orchestration with workflow templates for systematic service restoration procedures
- 7Cloud resource management automating AWS, Azure, or GCP infrastructure provisioning and decommissioning
Prerequisites
- Minimum 4GB RAM and 2 CPU cores for AWX components plus database overhead
- Docker host with at least 20GB available storage for PostgreSQL data and project repositories
- Network access to target systems on SSH (port 22) and WinRM (ports 5985/5986) for managed hosts
- Understanding of Ansible playbook structure, YAML syntax, and inventory management concepts
- Git repository access for storing and versioning Ansible project files and playbooks
- SSL certificates for production deployments requiring encrypted web interface access
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 awx-web: 3 image: ghcr.io/ansible/awx:latest4 container_name: awx-web5 hostname: awx-web6 environment: 7 - DATABASE_HOST=db8 - DATABASE_NAME=awx9 - DATABASE_USER=awx10 - DATABASE_PASSWORD=${DB_PASSWORD}11 - REDIS_HOST=redis12 - SECRET_KEY=${SECRET_KEY}13 - AWX_ADMIN_USER=admin14 - AWX_ADMIN_PASSWORD=${ADMIN_PASSWORD}15 volumes: 16 - awx-projects:/var/lib/awx/projects17 - awx-receptor:/var/run/receptor18 ports: 19 - "8052:8052"20 depends_on: 21 - db22 - redis23 networks: 24 - awx-network25 restart: unless-stopped2627 awx-task: 28 image: ghcr.io/ansible/awx:latest29 container_name: awx-task30 command: launch_awx_task.sh31 environment: 32 - DATABASE_HOST=db33 - DATABASE_NAME=awx34 - DATABASE_USER=awx35 - DATABASE_PASSWORD=${DB_PASSWORD}36 - REDIS_HOST=redis37 - SECRET_KEY=${SECRET_KEY}38 - SUPERVISOR_WEB_CONFIG_PATH=/etc/supervisor/conf.d/39 volumes: 40 - awx-projects:/var/lib/awx/projects41 - awx-receptor:/var/run/receptor42 depends_on: 43 - awx-web44 networks: 45 - awx-network46 restart: unless-stopped4748 db: 49 image: postgres:15-alpine50 container_name: awx-db51 environment: 52 - POSTGRES_USER=awx53 - POSTGRES_PASSWORD=${DB_PASSWORD}54 - POSTGRES_DB=awx55 volumes: 56 - postgres-data:/var/lib/postgresql/data57 networks: 58 - awx-network59 restart: unless-stopped6061 redis: 62 image: redis:7-alpine63 container_name: awx-redis64 volumes: 65 - redis-data:/data66 networks: 67 - awx-network68 restart: unless-stopped6970volumes: 71 awx-projects: 72 awx-receptor: 73 postgres-data: 74 redis-data: 7576networks: 77 awx-network: 78 driver: bridge.env Template
.env
1# Ansible AWX2ADMIN_PASSWORD=secure_admin_password3DB_PASSWORD=secure_awx_password45# Generate with: openssl rand -hex 326SECRET_KEY=your_secret_key_hereUsage Notes
- 1Web UI at http://localhost:8052
- 2Login: admin / (ADMIN_PASSWORD)
- 3Create projects from Git repos
- 4Define inventories and templates
- 5Schedule playbook runs
Individual Services(4 services)
Copy individual services to mix and match with your existing compose files.
awx-web
awx-web:
image: ghcr.io/ansible/awx:latest
container_name: awx-web
hostname: awx-web
environment:
- DATABASE_HOST=db
- DATABASE_NAME=awx
- DATABASE_USER=awx
- DATABASE_PASSWORD=${DB_PASSWORD}
- REDIS_HOST=redis
- SECRET_KEY=${SECRET_KEY}
- AWX_ADMIN_USER=admin
- AWX_ADMIN_PASSWORD=${ADMIN_PASSWORD}
volumes:
- awx-projects:/var/lib/awx/projects
- awx-receptor:/var/run/receptor
ports:
- "8052:8052"
depends_on:
- db
- redis
networks:
- awx-network
restart: unless-stopped
awx-task
awx-task:
image: ghcr.io/ansible/awx:latest
container_name: awx-task
command: launch_awx_task.sh
environment:
- DATABASE_HOST=db
- DATABASE_NAME=awx
- DATABASE_USER=awx
- DATABASE_PASSWORD=${DB_PASSWORD}
- REDIS_HOST=redis
- SECRET_KEY=${SECRET_KEY}
- SUPERVISOR_WEB_CONFIG_PATH=/etc/supervisor/conf.d/
volumes:
- awx-projects:/var/lib/awx/projects
- awx-receptor:/var/run/receptor
depends_on:
- awx-web
networks:
- awx-network
restart: unless-stopped
db
db:
image: postgres:15-alpine
container_name: awx-db
environment:
- POSTGRES_USER=awx
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=awx
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- awx-network
restart: unless-stopped
redis
redis:
image: redis:7-alpine
container_name: awx-redis
volumes:
- redis-data:/data
networks:
- awx-network
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 awx-web:5 image: ghcr.io/ansible/awx:latest6 container_name: awx-web7 hostname: awx-web8 environment:9 - DATABASE_HOST=db10 - DATABASE_NAME=awx11 - DATABASE_USER=awx12 - DATABASE_PASSWORD=${DB_PASSWORD}13 - REDIS_HOST=redis14 - SECRET_KEY=${SECRET_KEY}15 - AWX_ADMIN_USER=admin16 - AWX_ADMIN_PASSWORD=${ADMIN_PASSWORD}17 volumes:18 - awx-projects:/var/lib/awx/projects19 - awx-receptor:/var/run/receptor20 ports:21 - "8052:8052"22 depends_on:23 - db24 - redis25 networks:26 - awx-network27 restart: unless-stopped2829 awx-task:30 image: ghcr.io/ansible/awx:latest31 container_name: awx-task32 command: launch_awx_task.sh33 environment:34 - DATABASE_HOST=db35 - DATABASE_NAME=awx36 - DATABASE_USER=awx37 - DATABASE_PASSWORD=${DB_PASSWORD}38 - REDIS_HOST=redis39 - SECRET_KEY=${SECRET_KEY}40 - SUPERVISOR_WEB_CONFIG_PATH=/etc/supervisor/conf.d/41 volumes:42 - awx-projects:/var/lib/awx/projects43 - awx-receptor:/var/run/receptor44 depends_on:45 - awx-web46 networks:47 - awx-network48 restart: unless-stopped4950 db:51 image: postgres:15-alpine52 container_name: awx-db53 environment:54 - POSTGRES_USER=awx55 - POSTGRES_PASSWORD=${DB_PASSWORD}56 - POSTGRES_DB=awx57 volumes:58 - postgres-data:/var/lib/postgresql/data59 networks:60 - awx-network61 restart: unless-stopped6263 redis:64 image: redis:7-alpine65 container_name: awx-redis66 volumes:67 - redis-data:/data68 networks:69 - awx-network70 restart: unless-stopped7172volumes:73 awx-projects:74 awx-receptor:75 postgres-data:76 redis-data:7778networks:79 awx-network:80 driver: bridge81EOF8283# 2. Create the .env file84cat > .env << 'EOF'85# Ansible AWX86ADMIN_PASSWORD=secure_admin_password87DB_PASSWORD=secure_awx_password8889# Generate with: openssl rand -hex 3290SECRET_KEY=your_secret_key_here91EOF9293# 3. Start the services94docker compose up -d9596# 4. View logs97docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/ansible-awx/run | bashTroubleshooting
- awx-web container fails with database connection errors: Verify DB_PASSWORD environment variable matches across awx-web, awx-task, and PostgreSQL containers
- Job execution fails with 'receptor' connection timeout: Check awx-receptor volume mount permissions and ensure both awx-web and awx-task containers can write to shared socket
- Playbook tasks hang on 'Gathering Facts': Confirm target hosts are reachable via SSH and AWX execution environment has proper network routing
- Web interface shows 500 errors after container restart: Run database migrations by executing 'awx-manage migrate' inside awx-web container
- Redis connection refused errors in job logs: Verify redis container is healthy and awx-network allows inter-service communication on default Redis port 6379
- Secret key validation errors preventing login: Ensure SECRET_KEY environment variable is consistent across all AWX containers and persists between restarts
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
awx-webawx-taskpostgresqlredisreceptor
Tags
#ansible#awx#automation#tower#configuration-management
Category
DevOps & CI/CDAd Space
Shortcuts: C CopyF FavoriteD Download