Go back

How to enable Https for Ansible AWX

Below are the steps to enable Https for Ansible AWX :

  1. Open Terminal and stop the docker container using below command
sudo docker stop tools_awx_1 tools_postgres_1 tools_redis_1

/img/common/ansible-https-guide/stop-containers.png

  1. Update nginx.conf file to enable HTTPS:

Switch to root user using below command:.

sudo su

Open nginx.conf file in VIM editor using below command:

vi /home/ubuntu/setup/awx/tools/docker-compose/_sources/nginx.conf

/img/common/ansible-https-guide/vi-command.png

Once file is opened in vim, type ‘i’ (without quotes) in vi editor to enable insert mode.
In vi, goto line 56 and edit the line from

listen 8043 default_server;

to

listen 8043 default_server ssl;

/img/common/ansible-https-guide/add-ssl.png

Also uncomment below two lines, line 62 and 63. :

ssl_certificate /etc/nginx/nginx.crt;
ssl_certificate_key /etc/nginx/nginx.key;

/img/common/ansible-https-guide/uncomment-key-certificate.png

The final page should look like below- /img/common/ansible-https-guide/final-nginx-file.png

save the file by clicking “escape” key and then typing :wq

  1. Once the config file is updated, restart the docker container using below command:
sudo docker start tools_awx_1 tools_postgres_1 tools_redis_1

/img/common/ansible-https-guide/docker-restart.png

Note: If after running docker restart command you see below error message, just restart your VM and try again to restart the docker container

/img/common/ansible-https-guide/docker-restart-error.png

Wait for couple of minutes and then access the AWX webconsole over https using the url “https://vm_public_ip :80 ” . Make sure you type ":80" after the ip address . The console should be now accessible via https.
To get the login credential, run below command in terminal :

sudo docker logs tools_awx_1 | grep 'Admin password'

Note: You will get certificate warning in browser while accessing the web ui which you need to accept to proceed with login.

/img/common/ansible-https-guide/certificate-warning.png

/img/common/ansible-https-guide/awx-login-2.png

Go back