How To Install Ansible AWX on Ubuntu 19.04 Linux

0
47

In this tutorial, we are going to Install Ansible AWX on Ubuntu 19.04 with Nginx Reverse Proxy and optional Let’s Encrypt SSL Certificates.

What is Ansible AWX?

It is an open source distribution help us in various way like providing a web-based user interface, REST API, and task engine for smooth & collaborative management of Ansible Playbooks & Inventories.
AWX allows you to perform all these jobs from a web interface. At the end of this tutorial, you’ll be able to Install Ansible AWX on Ubuntu 19.04 easily.

Pre-Requisite for your System

  • Ubuntu 19.04 LTS Server.
  • 4GB RAM (Minimum)
  • 2vcpus (More is better)
  • 10 GB free disk storage
  • Root privileges

Now, we move further toward Installation process.

Step 1: Update the Ubuntu System

Run the given command to update & upgrade system.

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

Step 2: Install Ansible on Ubuntu

Type the following command to Install the latest release of Ansible AWX on Ubuntu 19.04.

echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main" |  sudo tee /etc/apt/sources.list.d/ansible.list 
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
sudo apt update
sudo apt install -y ansible

Check the Installed Version

ansible --version

Step 3: Install Docker & Docker Compose for Ansible AWX

It is necessary to have Installed Docker & Docker Compose as Ansible relay on Docker Engine to start its services.

How To Install Docker on Ubuntu 19.04

How To Install Latest Docker Compose on Linux

Note: You should be able to print Docker version after Installation.

docker version

Step 4: Install Node & NPM

Run the below command to Install Node & NPM on your Ubuntu System.

sudo apt isntall -y nodejs npm
sudo npm install npm --global

Step 5: Install Ansible AWX on Ubuntu 19.04

Type the following command to Install docker-py python module.

sudo apt -y install python-pip git pwgen vim
sudo pip install requests==2.14.2

Now, Install Docker Compose module. ( It should be same version as Docker Compose)

$ docker-compose version
docker-compose version 1.24.1, build 4667896
docker-py version: 3.7.3
CPython version: 3.6.8
OpenSSL version: OpenSSL 1.1.0j 20 Nov 2018
$ sudo pip install docker-compose==1.24.1

Run the given command to Clone AWX source code.

sudo su -
git clone --depth 50 https://github.com/ansible/awx.git

Change to Installer directory.

cd awx/installer

Open the inventory file & customize it according to your own requirements.

$ nano inventory

Generate AWX secret key.

pwgen -N 1 -s 30
2fCkx2K5GnIjBz4OterhOC3ey0WPdj

Set up inventory settings.

dockerhub_base=ansible
awx_task_hostname=awx
awx_web_hostname=awxweb
postgres_data_dir=/tmp/pgdocker
host_port=80
host_port_ssl=443
docker_compose_dir=/tmp/awxcompose
pg_username=awx
pg_password=awxpass
pg_database=awx
pg_port=5432
rabbitmq_password=awxpass
rabbitmq_erlang_cookie=cookiemonster
admin_user=admin
admin_password=StrongAdminpassword
create_preload_data=True
secret_key=2fCkx2K5GnIjBz4OterhOC3ey0WPdj

Run the playbook

You must run ansible-playbook command followed by option -i which shows the system that it is inventory file. install.yml is the playbook file name.

See the output, Check out if you got any error message.

Type and execute docker ps command to get list of currently running containers.

You can access web portal via hostip_or_hostname:8000 or port 80 if you did not change it. You will see a welcome Wizard.

Provide authentication details as you’ve setup in inventory file. It will take you to the admin dashboard.

Congratulations! You’ve finished Installing Ansible Awx on Ubuntu Linux.

LEAVE A REPLY

Please enter your comment!
Please enter your name here