I've been following instructions for setting up custom virtual environments on AWX.
Steps so far:
/var/lib/awx/venv/py2
and /var/lib/awx/venv/py3
PATCH
request to update venv path setting
http://localhost:8052/api/v2/settings/system
{ "CUSTOM_VENV_PATHS": ["/var/lib/awx/venv/"] }
The /api/v2/config
endpoint never shows anything but the default virtualenv.
"custom_virtualenvs": [
"/var/lib/awx/venv/ansible/"
]
Other things I've tried:
CUSTOM_VENV_PATHS = ['/var/lib/awx/venv/']
in /etc/tower/settings.py
What am I missing?
Resources:
https://docs.ansible.com/ansible-tower/latest/html/upgrade-migration-guide/virtualenv.html
https://github.com/ansible/awx/blob/devel/docs/custom_virtualenvs.md
The solution was to add the virtual environments to both the AWX web image and the AWX task image.
The virtual environments weren't registering because I had only added them to the task image. Once I added them to both the task and web images I was able to use the virtual environments without running the PATCH request or providing any additional configuration. (This is because I put the virtual environments in the default directory /var/lib/awx/venv/
).