1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

apt: autoinstall python-apt if not available

This commit is contained in:
Rene Moser 2013-10-21 16:39:18 +02:00
parent 8a516d1479
commit a10e017d6e

View file

@ -322,6 +322,12 @@ def main():
) )
if not HAS_PYTHON_APT: if not HAS_PYTHON_APT:
try:
module.run_command('apt-get install python-apt -y -q')
global apt, apt_pkg
import apt
import apt_pkg
except:
module.fail_json(msg="Could not import python modules: apt, apt_pkg. Please install python-apt package.") module.fail_json(msg="Could not import python modules: apt, apt_pkg. Please install python-apt package.")
global APTITUDE_CMD global APTITUDE_CMD