How to find Ansibles depenencies?

tl;dr: How to find (list) ansibles dependecies?

You can find the list of requirements for each plugin in their documentation, for the apt module it’s ansible.builtin.apt module – Manages apt-packages — Ansible Community Documentation

Now apparently python3-apt can neither be installed via pip , nor the system one can be used (of course it is installed globally using apt install python3-apt ).

Unfortunately the apt module depends on the apt Python bindings that are only available for the system Python which you have to use in order to run the apt module. The same case applies to e.g. the dnf module. Fortunately this is being worked on, see Ansible supported Python version on _target_ - #17 by Thulium-Drake.

As I wrote, this does not work, since my Ansible needs an old Python

As @nsavich already said, there’s no other way than to set ansible_python_interpreter to the system Python that has the apt bindings in order to use the module. I am curious what is the system Python version that your ansible-core version doesn’t support?

Another alternative is to pip install different ansible-core version that satisfy your environment.

3 Likes