How can I install additional Python packages and save changes in containers for AAP (2.4)?

I installed AAP 2.4 containerized in a Linux VM (VMWare Workstation, redhat 8). It works fine. But I do need to install an additional Pythin package, in my case it is PyU4V for Dell PowerMax storage ansible modules. I am able to install it on the AAP VM and the automation playbooks run fine locally (not from AAP). But the same code failed when I launch the job in AAP. It conplaims missing PyU4V package. I understand it might be related to containized environment. I tried to run the PyU4V installation task before the storage configuration tasks. Even the PyU4V installation task completes but the followed storage calls failed due to missing PyU4V package. My guess is that container does not see that package has been installed? I am not expert in container area. What is the best solution for that? I don’t think I should be creating my own image and re-install AAP.

Thanks,

J

1 Like

Add a pre-step where you install the missing package via pip in your playbook https://docs.ansible.com/ansible/latest/collections/ansible/builtin/pip_module.html

The better solution would be to create an execution environment that has your dependencies pre-installed. https://docs.ansible.com/automation-controller/latest/html/userguide/execution_environments.html?extIdCarryOver=true&sc_cid=701f2000001Css5AAC

1 Like

Continuing the discussion from How can I install additional Python packages and save changes in containers for AAP (2.4)?:

Thanks. I will try option 2 - creating EE. Two more questions:

I installed AAP 2.4 on RHEL 8 using containerized package and it seems no Automation Hub component in there (or maybe I am doing something wrong). Is it true that containerized installation does not have AUtomation Hub which I can use it for private registry.

If I don’t use Automation Hub, can EE uses other party’s image registry such as GitHub?

Thanks,

J

I don’t use AAP, so you’ll have to contact RedHat with questions specific to it.

I use AWX, which is the upstream version of AAP (I think). If AAP works like AWX does, you can use any third party repository to host container images, such as ghcr.io (Github’s container registry). I build and publish images on github and consume them in AWX. You’re always free to try things out for yourself, y’know.