Below are the steps to enable Https for Ansible AWX :
sudo openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
Above command will ask for inputs like Country code, email address etc. which you provide accordingly.
sudo docker cp certificate.pem awx_web:/etc/nginx/
sudo docker cp key.pem awx_web:/etc/nginx/
sudo docker stop awx_web
Switch to root user using below command:.
Open nginx.conf file in VIM editor using below command:
Once file is opened in vim, type ‘i’ (without quotes) in vim to enable insert mode.
In vim, goto line 41 and edit the line from
listen 8052 default_server;
listen 8052 ssl default_server;
Also add below two lines after line 41 :
save the file by clicking “escape” key and then typing :wq
sudo docker start awx_web
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 :
Note: If you are running azure vm, please use below login credentials
Note: If you are using self signed certificate, you will get certificate warning in browser which you need to accept to proceed with login