I received this error after adding some extra virtual environments in my AWX Kubernetes deployment. Hereby my troubleshooting steps and how I was able to resolve this (human)-error.
- Check if all your AWX / Tower task and web containers has the opt/custom-vens directory available. If the directories are not placed there, check your install script.
- The most common mistake is that the new custom venv directory is not (correctly) added to the global AWX settings. My fault was that I added the whole path including my custom venv to the global settings.
First we need to enable the new virtualenv path globally.
Change the URL, Username and Password and Custom Environment to your own variables.
1 2 |
curl -X PATCH 'https://user:password@tower.example.org/api/v2/settings/system/' \ -d '{"CUSTOM_VENV_PATHS": "/opt/custom-venvs/"}' -H 'Content-Type:application/json' |
After that we can assign that venv to our organization, job templates, projects and inventory.
1 2 3 4 5 6 7 8 9 10 11 |
curl -X PATCH 'https://username:password@awx-host.example.org/api/v2/organizations/X/' \ -d '{"custom_virtualenv": "/opt/custom-venvs/test"}' -H 'Content-Type:application/json' curl -X PATCH 'https://username:password@awx-host.example.org/api/v2/projects/X/' \ -d '{"custom_virtualenv": "/opt/custom-venvs/test"}' -H 'Content-Type:application/json' curl -X PATCH 'https://username:password@awx-host.example.org/api/v2/job_templates/X/' \ -d '{"custom_virtualenv": "/opt/custom-venvs/test"}' -H 'Content-Type:application/json' curl -X PATCH 'https://username:password@awx-host.example.org/api/v2/inventory_sources/X/' \ -d '{"custom_virtualenv": "/opt/custom-venvs/tst"}' -H 'Content-Type:application/json' |