Missing python library

Hi,

My playbook uses lookup with dig, which needs the dnspython library. [1]

I’ve installed the library on the system with pip and cli ansible-playbook execution just works as expected.

Unfortunately with AWX it fails:

FAILED! => {“failed”: true, “msg”: “An unhandled exception occurred while running the lookup plugin ‘dig’. Error was a <class ‘ansible.errors.AnsibleError’>, original message: The dig lookup requires the python ‘dnspython’ library and it is not installed”}

Not sure if this is related to Bubblewrap and how to include the missing library.

Any hints?

Marc

[1] http://docs.ansible.com/ansible/latest/playbooks_lookups.html#the-dns-lookup-dig

Hmm, ok… seems that I need to modify requirements/requirements_ansible.txt and then rebuild everything?

or can I add it as a request to be added to the prebuild docker images?

Was in a similar situation as you. I found that modifying the requirements.txt was a bit complicated because they contain specific dependency versions, and I didn’t want to get into rebuilding them. Instead I modified the Dockerfile for the task container to include what I needed, which is working for me for now.

I doubt the project is going to include anything like that in the official images since every users needs will vary.

Could you tell me where exaclty you did it?

Currently I simply install dnssearch within the container and set a reminder that if I would update it, i would need to reinstallt it :wink:

For now I’m doing the same thing: I just keep a list of packages I need to pip install every time I rev the awx_task container. I do so infrequently enough that it’s just easier to do that than build my own images or mess with the installer.