Missing python modules in container_group triggered pods

Hello Team,

I’m trying to make use of the container_groups feature in my AWX project on K8s.

Found out that the normal tower instance uses two python virtual environments (/var/lib/awx/venv/awx and /var/lib/awx/venv/ansible) and when jobs are triggered it uses the ansible venv and gets all the available python modules (pre-installed).

But when I am using container_groups, the jobs against Linux boxes are working fine but have problems connecting to Windows servers (fails with no module found - pywinrm).

On checking the container group triggered pods, it doesn’t have any venv and does not have the required python modules (for example, pywinrm/pykerberos/requests). Not sure, whether am missing anything in pod definition.

Please see the attached pod.yml am using for the container groups and let me know if there is any fix/solution to this issue.

Appreciate your earliest response.

Regards,
Vibin

(attachments)

pod-definition.txt (4.41 KB)

Hello,

Have you tried including a task to install the required python modules in the playbook?

Hello,

Thanks for the response.

Nope, but then that’ll require all playbooks to have that task with them which I feel won’t be appealing to the developers.

I was more looking for a solution which can be manipulated with the container group pod definition or out of the box with this feature.

Regards,
Vibin

Hello All,

Figured it out.

If you are using container groups, then another image comes into play ie; ansible-runner and it has a very limited set of python modules which are used while running jobs.

So if you wanna add new modules, then you need to do that in the ansible runner image.

Also, we don’t need to have additional containers in the container group POD definition file. Just the default one is enough (change the namespace and add other details as needed).

Hope this helps someone facing issues like I had.

Regards,
Vibin