8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | 23c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Articles » Linux » Here

AWX Installation on Oracle Linux 7 (OL7) Using the Docker-Compose Method

This article describes how to install AWX, the upstream project for Ansible Tower, on Oracle Linux 7 (OL7) using the Docker-Compose method.

Related articles.


There is a Vagrant build that allows you to complete this whole installation, including Docker and AWX, in a single command available here.


Install Docker

The installation of Docker on Oracle Linux is described in full here. To keep things simple I've abbreviated it here. Some of these actions are destructive, so if in doubt read the related article.

Make sure the relevant repositories are enabled.

yum install yum-utils zip unzip -y
yum-config-manager --enable ol7_optional_latest
yum-config-manager --enable ol7_addons
yum-config-manager --enable ol7_preview
yum-config-manager --enable ol7_developer
yum install -y oracle-epel-release-el7
yum-config-manager --enable ol7_developer_EPEL

Install the Docker engine OS packages.

yum install -y docker-engine btrfs-progs btrfs-progs-devel

Complete the Docker installation. This assumes the disk used for the docker images is "/dev/sdc".

# Partition to "/dev/sdc" disk, and configure it for use as "/var/lib/docker" mount point.
echo -e "n\np\n\n\n\nw" | fdisk /dev/sdc
docker-storage-config -s btrfs -d /dev/sdc1

# Enable the Docker service.
systemctl enable docker.service
systemctl start docker.service
systemctl status docker.service

Install AWX

Install the required Ansible, PIP and Git packages.

yum install -y ansible python-pip3 python3-devel libselinux-python3 git gcc

Make sure the Python libraries are present for Docker and Docker-Compose.

pip3 install --upgrade pip
pip3 install docker
pip3 install docker-compose

Clone the AWX repository and switch to the installer directory.

cd /u01/
git clone https://github.com/ansible/awx.git
cd awx/installer

Amend the contents of the "./inventory" file as you see fit. It includes an assortment of paths and credentials. You could do the run without amending any of these and it will work, but for anything other than a playground it's worth making some changes. Here are some of the obvious things you may want to change.










In my Vagrant build I use the following sed commands to make changes based on environment variable values. It will give you an idea of what you should be considering amending.

# For a real installation, you will probably need to change many of these.
sed -i -e "s|awx_task_hostname=awx|awx_task_hostname=${AWX_TASK_HOSTNAME}|g" ./inventory
sed -i -e "s|awx_web_hostname=awxweb|awx_web_hostname=${AWX_WEB_HOSTNAME}|g" ./inventory

sed -i -e "s|postgres_data_dir=\"~/.awx/pgdocker\"|postgres_data_dir=${POSTGRES_DATA_DIR}|g" ./inventory

sed -i -e "s|host_port=80|host_port=${HOST_PORT}|g" ./inventory
sed -i -e "s|host_port_ssl=443|host_port_ssl=${HOST_PORT_SSL}|g" ./inventory

sed -i -e "s|docker_compose_dir=\"~/.awx/awxcompose\"|docker_compose_dir=${DOCKER_COMPOSE_DIR}|g" ./inventory

sed -i -e "s|pg_username=awx|pg_username=${PG_USERNAME}|g" ./inventory
sed -i -e "s|pg_password=awxpass|pg_password=${PG_PASSWORD}|g" ./inventory
sed -i -e "s|pg_database=awx|pg_database=${PG_DATABASE}|g" ./inventory
sed -i -e "s|pg_port=5432|pg_port=${PG_PORT}|g" ./inventory

sed -i -e "s|rabbitmq_password=awxpass|rabbitmq_password=${RABBITMQ_PASSWORD}|g" ./inventory

sed -i -e "s|admin_user=admin|admin_user=${ADMIN_USER}|g" ./inventory
sed -i -e "s|admin_password=password|admin_password=${ADMIN_PASSWORD}|g" ./inventory

sed -i -e "s|secret_key=awxsecret|secret_key=${SECRET_KEY}|g" ./inventory

sed -i -e "s|#project_data_dir=/var/lib/awx/projects|project_data_dir=${PROJECT_DATA_DIR}|g" ./inventory

You are now in a position to install AWX. Issue the following command to run the installation playbook.

ansible-playbook -i inventory install.yml

Use It

Once the installation is complete, you should have a running AWX environment. The web interface is available from the following URLs by default.


In my vagrant build I use port forwarding to make them available from the following URLs on my host machine.


For more information see:

Hope this helps. Regards Tim...

Back to the Top.