The standard AWX deployment comes with a standard Python virtual environment with some pre-installed python modules. These default modules are suitable if you use only the default Ansible playbooks. If you want to use custom Python modules you usually need more than the default set Python Modules.
Changing the default modules with hacking the default containers, is not the way to go in a dynamic Kubernetes deployment. Luckily they created a simpler way to archive this. This is only possible if you deploy your AWX Instances with the default install playbooks provided in the official AWX git repo. You can safely run this command against your running AWX instances. It just redeploy your running containers with custom venvs.
Add the parameter “–extra-vars” to your install play, like this:
ansible-playbook -i inventory install.yml --extra-vars '@venv_vars.yaml'
In this venv_vars.yaml it is possible to define custom venvs with other installed Python modules. The structure can look like this example:
- name: zeep
python: python3 # Defaults to python2
- name: vmware