In Today’s tutorial, we will be installing ansible Awx (Ansible web executable). This is an open-source project that allows you to manage and control your ansible project easily from a web interface with a task engine that is built on ansible. We will be installing AWX on centos 8 servers with 4GB RAM with Epel repository installed. Kindly check out some of my other guides: Openstack Deployment with Devstack, Deploying a load balancer from scratch and adding backend servers, how to monitor services using Zabbix, and how to set-up PowerShell on a Linux server. LET’S GET STARTED.
First let’s Disable SELINUX
Next install the epel repository
dnf install epel-release -y
Now we will install some dependent packages
dnf install git gcc gcc-c++ ansible nodejs gettext device-mapper-persistent-data lvm2 bzip2 python3-pip -y
Next we will install docker, so we can run AWX in a container. We have to add the docker repository to the system using the below command
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
Install Docker and verify docker version
dnf install docker-ce -y
Then start and enable docker to load at start up
systemctl start docker
systemctl enable docker
Now that we have our docker running, lets install AWX. We have to download the latest version from git hub using the following command below
git clone https://github.com/ansible/awx.git
The next step is very important as we have to generate a secret key to encrypt the inventory file using the command below. Save this key as it will be needed
openssl rand -base64 30
Next cd into the installer directory, vim and edit the file with the following parameters
[all:vars] dockerhub_base=ansible awx_task_hostname=awx postgres_data_dir="/var/lib/pgdocker" host_port=80 host_port_ssl=443 docker_compose_dir="~/.awx/awxcompose" pg_username=awx pg_password=awxpass pg_database=awx pg_port=5432 pg_admin_password=password rabbitmq_password=awxpass rabbitmq_erlang_cookie=cookiemonster admin_user=admin admin_password=password create_preload_data=True secret_key=wnwsaB7Z1KbNWTFuedc8LF9+XFpOIHCA38QwqSto awx_official=true awx_alternate_dns_servers="18.104.22.168,22.214.171.124" project_data_dir=/var/lib/awx/projects
Create the postgres directory
Once this is done, in the installer directory, run the command to install AWX.
ansible-playbook -i inventory install.yml
Once your docker has been installed and all the required dockers started. We have to verify the status using the following command
Now that installation is completed and dockers verified. Lets add the https service to the firewall
firewall-cmd --zone=public --add-masquerade --permanent firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-service=https firewall-cmd –reload
Now try to access the dashboard using your server IP.
Now we have deployed an ansible tower instance and can use this to manage and schedule jobs on our remote nodes using ssh credentials or ssh keys.