Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

Install Ansible AWX Tower on Ubuntu Linux

Ansible is a software tool that offers simple but powerful automation for cross-platform operating systems and computer support. It is mainly planned for IT professionals, who use it for application deployment, updates on workstations and servers, cloud provisioning, configuration management, intra-service orchestration, and nearly everything a systems administrator does on a weekly or daily basis. Ansible doesn't have any dependency such as client agent software and has no extra security infrastructure, so it's easy to deploy and implement. The AWX allows you to manage Ansible playbooks, inventories, and schedule jobs to run using the web interface.

The Ansible AWX Project is an open source community project, easy-to-use UI and dashboard and REST API for Ansible, sponsored by Red Hat, that allows users to have better control their Ansible project use in IT environments. AWX is the upstream project from which the Red Hat Ansible Tower offering is finally derived.

To start ansible AWX tower installation I have setup my Ubuntu Server 20.04, the steps shown here also applicable on other ubuntu version 18.04. I am running my virtual machine with lowest minimum hardware configuration with 1 vCPU, 1 GB RAM, 20 GB Disk. 

Make sure you have sudo access (root access), First update and upgrade your operating system and reboot the system.

su -
sudo apt update && sudo apt -y upgrade
sudo reboot

install ansible tower ansible awx ubuntu redhat linux su - sudo user sudo apt update && sudo apt -y upgrade sudo reboot dependency building tree packages.png

Install additional packages python-setuptools and python3-pip to install latest version of Ansible using pip3. Once Ansible is installed test it with sample one-liner ansible adhoc command script.

To install Ansible on Redhat, CentOS use article How to install Ansible on Linux for vSphere configuration.

sudo apt install python-setuptools -y
sudo apt install python3-pip -y
sudo pip3 install ansible
ansible localhost -m ping

Install ansible awx tower on ubuntu linux redhat centos sudo apt install python-setuptools python3-pip -y sudo pip3 install ansible apt-get yum repository yaml ansible-playbook ansible ping test localhost.png

Ansible AWX components are installed as a container, for this I will use docker engine to host containers. Install docker-compose using pip3, Then install packages docker and docker.io., Test the version of docker-compose and docker. Give access to docker group for current logged in user.

To install docker on RedHat or CentOS follow article How to install Docker on Linux.

sudo pip3 install docker-compose
sudo apt install docker docker.io -y
docker-compose version
docker version
sudo usermod -aG docker $USER

Install ansible tower ansible awx ubuntu redhat linux centos sudo pip3 install docker-compose sudo apt install docker docker.io -y docker-compose version docker version usermode -aG $USER.png

Next install additional packages git, vim and pwgen

sudo apt install git vim pwgen -y

install ansible awx tower on ubuntu linux redhat sudo apt install git vim pwgen automation dependency archive.ubuntu package database unpack.png

Clone (download) Ansible AWX source code/ scripts from github.com. Change the directory to axw/installer. Generate new secret key with pwgen, I will use this key later. Edit inventory file with vim kept under awx/installer. 

sudo git clone https://github.com/ansible/awx.git
ls
cd awx/installer
pwgen -N 1 -s 30
vim inventory

Install ansible awx tower on ubuntu linux redhat sudo git clone github ansible awx.git ls awx installer install.yml inventory pwgen -N 1 -s 30 vim inventory setup.png

Modify admin_password and secret_key (earlier generated with pwgen). Remember admin_password it will be used later on the awx web interface to login. Below is how my template's minimal version looks like.

cat inventory | grep -v '^#' | sed '/^\s*#/d;/^\s*$/d'

install ansible tower awx on ubuntu linux redhat centos cat inventory awx installer pgdocker postgress_data_dir admin_password secret_key docker hub awx_web_hostname  awxweb grep sed.png

Implement the yml playbook, it takes some time to download docker container images and set them up accordingly. In the last check the deployied containers with docker ps command. 

Ansible AWX installation error Cannot have both the docker-py and docker python modules
Ansible AWX installation error docker-compose run --rm --service-ports task awx-manage migrate --no-input
docker: Got permission denied while trying to connect to the Docker daemon socket

ansible-playbook -i inventory install.yml
docker ps

install ansible awx tower on ubuntu linux redhat centos ansible-playbook -i inventory install.yml docker ps yaml container awx web based.png

Verify the Ansible awx url in the browser, for default username use admin and password use admin_password mentioned earlier in the template. Dashboard looks like below.

http://<Ansible AWX FQDN or IP>/#/login

Install ansible awx tower on ubuntu linux sign in page dashboard page ansible awx template credentials projects inventories hosts organizations.png

Useful Articles
Getting started Ansible AWX tower for IT automation run first playbook
Ansible for VMwary Using vmware_vm_inventory dynamic inventory plugin
Ansible selectattr The error was TemplateRuntimeError no test named 'equalto'
ansible create an array with set_fact
Ansible get information from esxi advanced settings nested dictionary with unique keynames

Go Back



Comment

Blog Search

Page Views

5571156

Follow me on Blogarama