Ansible and Ansible Tower Installation on AlmaLinux/CentOS Stream

This guide explains the difference between Ansible and Ansible Tower (AWX), followed by step-by-step installation instructions on AlmaLinux 9/10 and CentOS Stream 9/10 systems.

1. What is Ansible?

Ansible is an open-source IT automation and configuration management tool used for:

Ansible works without agents and uses SSH with YAML-based playbooks.

2. What is Ansible Tower?

Ansible Tower is the enterprise automation platform for managing Ansible environments. The upstream open-source version is called AWX.

Ansible Tower/AWX provides:

3. Difference Between Ansible and Ansible Tower

Feature Ansible Ansible Tower / AWX
Interface CLI Based Web UI + API
Management Manual Centralized Dashboard
Automation Playbooks Enterprise Workflow Automation
Scheduling Cron Jobs Built-in Job Scheduler
User Access Limited RBAC Support
Monitoring CLI Output Real-Time Monitoring
API Support Limited REST API Available
Best For Small/Medium Environments Enterprise Environments

Install Ansible on AlmaLinux/CentOS Stream 9/10

4. Prerequisites


- AlmaLinux 9/10 or CentOS Stream 9/10
- Sudo or root privileges
- Internet connectivity
- SSH enabled
- Minimum 4 GB RAM
- SELinux enabled

5. Set Hostname


sudo hostnamectl set-hostname ansible.example.com

6. Update System Packages


sudo dnf update -y

sudo reboot

7. Enable EPEL Repository


sudo dnf install -y epel-release

8. Install Required Packages


sudo dnf install -y \
wget \
curl \
git \
vim \
python3 \
python3-pip

9. Install Ansible


sudo dnf install -y ansible-core

10. Verify Ansible Installation


ansible --version

Install Ansible Tower (AWX) on AlmaLinux/CentOS Stream

11. Install Required Dependencies


sudo dnf install -y \
git \
curl \
tar \
wget \
make \
gcc \
python3-pip

12. Install Docker


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-plugin

13. Start and Enable Docker


sudo systemctl enable --now docker

14. Verify Docker Installation


docker --version

docker compose version

15. Disable Swap


sudo swapoff -a

16. Install kubectl


curl -LO "https://dl.k8s.io/release/$(curl -L -s \
https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

chmod +x kubectl

sudo mv kubectl /usr/local/bin/

17. Install Minikube


curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

sudo install minikube-linux-amd64 /usr/local/bin/minikube

18. Start Minikube Cluster


minikube start --driver=docker

19. Create AWX Namespace


kubectl create namespace awx

20. Install AWX Operator


git clone https://github.com/ansible/awx-operator.git

cd awx-operator

make deploy

21. Create AWX Deployment File


vi awx-deploy.yml

22. Example AWX Deployment Configuration


apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
spec:
  service_type: nodeport

23. Deploy AWX


kubectl apply -f awx-deploy.yml -n awx

24. Verify AWX Pods


kubectl get pods -n awx

25. Get AWX Admin Password


kubectl get secret awx-admin-password \
-n awx \
-o jsonpath="{.data.password}" | base64 --decode

26. Get AWX Service Information


kubectl get svc -n awx

27. Configure Firewall (Optional)


sudo firewall-cmd --permanent --add-port=30080/tcp

sudo firewall-cmd --reload

28. Access AWX Web Interface


http://SERVER-IP:NODEPORT

29. Default AWX Login


Username: admin

Password: Retrieved from Kubernetes Secret

30. Optional Post Installation Tasks


- Configure Organizations
- Configure Inventories
- Add Credentials
- Create Job Templates
- Configure Git Projects
- Configure LDAP/AD Authentication
- Setup SSL Certificates
- Configure Scheduled Jobs
- Create Automation Workflows