Hi
On AWX 20.1.0, kubernetes, trying to run the dig lookup plugin but get dnspython required but missing.
Have tried connecting to awx-ee pod
- pip install dnspython, but this installs into /home/runner/.local/lib/python3.8/site-packages. pip list -v shows other libraries in either /usr/local/lib/python3.8/site-packages or /usr/lib/python3.8/site-packages.
- pip install --target=/usr/lib/python3.8/site-packages dnspython gives “Permission denied”
- tried installing via a playbook but still shows as missing
I would have expected when the modules get installed that dependencies would be installed.
How do I install the required library?
If you need extra python libraries or binaries I would suggest creating an execution Environment using ansible-builder
https://www.ansible.com/blog/introduction-to-ansible-builder
Thanks worked perfectly for the python packages, but can you advise how to include none python based dependencies such as terraform? Tried including RUN dnf install but complains about sudo access and sudo command not found.
Simon
Did you use ansible-builder to build the environment? What does your execution-environment.yml look like?
I followed another guide my execution-environment.yml looks like below. I’ve tried adding RUN yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo and RUN yum install terraform. Maybe I’m being naive but the documentation isn’t suited to noobs
That’s a bit old and looks wrong. you don’t put in the directives like what you have.
here is an example of what i have:
---
version: 1
dependencies:
galaxy: requirements.yml
python: requirements.txt
system: bindep.txt
additional_build_steps:
append: |
RUN alternatives --set python /usr/bin/python3 && \
curl [https://packages.microsoft.com/config/rhel/7/prod.repo](https://packages.microsoft.com/config/rhel/7/prod.repo) | tee /etc/yum.repos.d/microsoft.repo && \
yum install -y powershell && \
pwsh -command "Install-Module -name PSAnsibleHelperFunctions4Linux -scope CurrentUser -force" && \
pwsh -command "Install-Module -name dbatools -RequiredVersion 1.0.145 -force -Verbose"
As
My bad, i still use RUN but i did not encounter sudo issues like yours.
That worked without complaining about sudo, had to remove && \ though, so for anyone else who might find it useful