How to add Python modules to AWX on Kubernetes

Posted by

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:

In this venv_vars.yaml it is possible to define custom venvs with other installed Python modules. The structure can look like this example:

After the deployment you also need to add your custom venvs path to AWX, like described in THIS post.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *