I am Using Ubuntu 18.04, Ansible 2.9, Python 3.6.9, have installed python3-apt
On a basic ansible command ansible -b all -m apt -a “name=apache2 state=latest” Get Error:
FAILED! => { “ansible_facts”: { “discovered_interpreter_python”: “/usr/bin/python” }, “changed”: false, “msg”: “Could not import python modules: apt, apt_pkg. Please install python3-apt package.”
Don’t know if it is asking for this package on my Server machine or Node m/c - I have installed it on both.
$ sudo apt-get install python3-apt
$ ansible --version
ansible 2.9.12
python version = 3.6.9
$ python --version
Python 3.7.6
Any ideas?