How can i add additional Python packages and save changes in Docker container for AWX

I need to install new Python packages for some of the Ansible modules. I have referred the documentation which specifies creation of virtual environment and then installing the packages inside the venv in awx_task container. I have completed the steps. Post this, i cannot find any document describing how to reflect the changes in AWX which are made in the docker container. Can someone help with this?

I cannot find the steps anywhere which specifies what needs to be done post installation of packages inside docker container (AWX_TASK).

Out PoC on AWX is stuck because of this, any help would be appreciated.

Regards,
Ankit

The way we do it, is that we have a custom role we call in install.yml, called post-setup, and what it basically does, is to run some docker exec commands, that deploy or build our own modules and python libraries inside the containers.

For example, we pull our repo and link the libraries:

  • name: clone
    command: “docker exec awx_task /usr/bin/hg clone https://hg/ /var/lib/”

  • name: link libraries
    command: “docker exec awx_task /usr/bin/ln -f -s /var/lib//python/ /var/lib/awx/venv/{{ item }}/lib/python2.7/site-packages/.”
    with_items:

  • library1

  • library2

Once that’s done, we commit and pushed that image to our registry which is used after in the deployment process.

-Cesar

Hi Cesar,

Thanks, but i guess that is for building fresh environment. In case, if i have already brought AWX up and made want to install new python libraries in existing awx containers and save the changes in docker containers, is there any document or can you please suggest the way to get that done?