Below are the steps to enable Https for Ansible AWX :
sudo docker stop tools_awx_1 tools_postgres_1 tools_redis_1
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
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;
Also uncomment below two lines, line 62 and 63. :
ssl_certificate /etc/nginx/nginx.crt;
ssl_certificate_key /etc/nginx/nginx.key;
The final page should look like below-
save the file by clicking “escape” key and then typing :wq
sudo docker start tools_awx_1 tools_postgres_1 tools_redis_1
Note: If after running docker restart command you see below error message, just restart your VM and try again to restart the docker container
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.