Learn how to install Ansible AWX on CentOS 7 with our step-by-step guide. Follow these instructions for a successful setup of the AWX web-based UI for Ansible automation. #centlinux #ansible #docker
Ansible AWX is an open-source web-based user interface for managing and visualizing Ansible automation. It provides a central platform for managing your Ansible playbooks, inventory, and credentials, offering features that streamline and enhance the automation process.
AWX is designed to make Ansible more usable for DevOps members of different technical proficiencies and skill sets. AWX is a hub for automation tasks. Ansible Tower is a commercial product supported by Red Hat, Inc. but derived from AWX upstream project, which is open source since September 2017. This makes AWX a good alternative of Ansible Tower.
Here are some key features and benefits of Ansible AWX:
AWX is essentially the upstream project for Red Hat’s Ansible Tower, which is the commercial version of AWX with additional features and support. If you’re using Ansible for automation, AWX provides an easy-to-use interface and management capabilities that can complement your automation efforts.
Recommended Training for You: Ansible Advanced – Hands-On – DevOps
Currently, stable version of AWX 7.0 has been released that requires a containerized environment to install and run. According to AWX Project Documentation, we can deploy AWX on following containerization platforms.
We are using Docker-Compose here, because it is relatively easy to setup and requires less hardware resources as compare to OpenShift and Kubernetes.
We have already install Ansible on CentOS 7. Now, we are installing AWX with Docker-Compose on the same Ansible control node.
We are using three CentOS 7 virtual machines with following specifications.
Read Also: How to install Ansible Semaphore on CentOS 8
Connect with ansible-01.centlinux.com by using ssh as root user.
AWX requires some packages that are available in EPEL (Extra Packages for Enterprise Linux) yum repository. Therefore, we are installing epel-release package by using yum command to enable EPEL.
# yum install -y epel-release
AWX requires some prerequisite software packages, all of these packages are available in standard and EPEL yum repositories.
Therefore, we are Installing all prerequisite packages using a single yum command.
# yum -y install git gcc gcc-c++ nodejs gettext device-mapper-persistent-data lvm2 bzip2 python-pip
Install Docker CE yum repository from Docker official website.
# yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo Loaded plugins: fastestmirror adding repo from: https://download.docker.com/linux/centos/docker-ce.repo grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo repo saved to /etc/yum.repos.d/docker-ce.repo
Since the Docker CE yum repository has been added, we can now install Docker CE using yum command.
# yum install -y docker-ce
Enable and start Docker service.
# systemctl enable --now docker.service Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
PyPI (Python Package Index) is a software package repository of software written in Python. PyPA (Python Package Authority) recommend use of PyPI for installation of Python software packages.
Therefore, we are installing docker-compose using pip command.
# pip install docker-compose
Use git command to download AWX project from GitHub.
# git clone --depth 50 https://github.com/ansible/awx.git Cloning into 'awx'... remote: Enumerating objects: 8850, done. remote: Counting objects: 100% (8850/8850), done. remote: Compressing objects: 100% (4428/4428), done. remote: Total 8850 (delta 5006), reused 6388 (delta 4234), pack-reused 0 Receiving objects: 100% (8850/8850), 11.30 MiB | 246.00 KiB/s, done. Resolving deltas: 100% (5006/5006), done.
Go to ~/awx/installer directory and set a custom admin_password for AWX and PostgreSQL in inventory file.
# cd awx/installer # sed -i 's|admin_password=.*|admin_password=Ahmer@1234|g' inventory
Generate a random key to use for encryption in inventory file.
# openssl rand -base64 30 ejv9P72oNvD4AtWLhOUTvpxfdIfKIid3skwuK+ES
Add the generated string as secret_key in inventory file.
# sed -i 's|secret_key=.*|secret_key=ejv9P72oNvD4AtWLhOUTvpxfdIfKIid3skwuK+ES|g' inventory
You can also customize many directives here, according to your requirements.
Verify the changes that we have made in inventory.
# grep -v '^#' inventory | grep -v '^
Install AWX by using ansible-playbook command.
# ansible-playbook -i inventory install.yml
Ansible uses docker-compose to create the required containers by AWX. It will take time, according to your server’s specs, therefore sit back and relax for a while.
After successful configuration of AWX and relevant containers. You can check the list of Docker processes to the running containers that are created by docker-compose for AWX.
# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2c36037e1edf ansible/awx_task:7.0.0 "/tini -- /bin/sh -câ¦" 2 minutes ago Up 2 minutes 8052/tcp awx_task 4af8c2a57530 ansible/awx_web:7.0.0 "/tini -- /bin/sh -câ¦" 2 minutes ago Up 2 minutes 0.0.0.0:80->8052/tcp awx_web 5580f44da60a memcached:alpine "docker-entrypoint.sâ¦" 2 minutes ago Up 2 minutes 11211/tcp awx_memcached 341e0660e369 ansible/awx_rabbitmq:3.7.4 "docker-entrypoint.sâ¦" 2 minutes ago Up 2 minutes 4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 25672/tcp awx_rabbitmq 6529a106ab89 postgres:10 "docker-entrypoint.sâ¦" 2 minutes ago Up 2 minutes 5432/tcp awx_postgres
Allow HTTP service in Linux firewall, because the port 80 is mapped to the AWX container and it is used to access AWX web console.
# firewall-cmd --permanent --add-service=http success # firewall-cmd --reload success
Open URL http://ansible01.centlinux.com in a web browser.
Login as Admin User.
We are reached at the dashboard of Ansible AWX.
If you want to improve your knowledge about Ansible, then you should refer to Ansible Documentation or get a copy of Ansible Quick Start Guide: Control and monitor infrastructures of any size, physical or virtual (PAID LINK) by Packt Publishing.
Installing Ansible AWX on CentOS 7 can significantly enhance your automation capabilities by providing a powerful web-based interface for managing your Ansible tasks. By following the steps outlined in this guide, you can set up a robust automation environment to streamline your IT operations.
If you need personalized assistance or have specific requirements for your AWX installation, I’m here to help! Check out my Fiverr gig: DevOps Engineer for professional support and tailored solutions for your Ansible and AWX needs.
Feel free to reach out if you have any questions or need further assistance. Happy automating!
Puppy Linux is a fast, lightweight OS designed for speed and simplicity, perfect for old…
Learn how to change Apache document root in Linux by following this step-by-step guide. Adjust…
Discover how to change Apache port in Linux easily. Follow our simple guide to modify…
Learn how to create a virtual host in Apache Server with this comprehensive guide. Set…
Discover 10 practical tasks for the RHCSA exam with step-by-step solutions. Boost your Linux skills…
Discover the ultimate Fail2ban configuration guide. Learn how to set up, customize, and optimize Fail2ban…
This website uses cookies.