Hi Elena, current version (2.12.4) should be smarter at detecting the OS release and picking the right python version:
https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html As such, I'm closing this bug. Regards, Lee On 20/05/2020 12:46, Elena ``of Valhalla'' wrote: > Package: ansible > Version: 2.7.7+dfsg-1 > Severity: important > > Dear Maintainer, > > on a minimal stable (buster) installation, ansible fails to run (at > least on the machine itself) because of a lack of the python (2) > interpreter. > > To reproduce, debootstrap an image (but installing from netinst without > adding things with tasksel also works): > > # mkdir buster > # debootstrap buster buster/ > # mount -t devtmpfs udev buster/dev/ > # chroot buster > > # ansible -i localhost, -m setup -c local all > > localhost | FAILED! => { > "changed": false, > "module_stderr": "/bin/sh: 1: /usr/bin/python: not found\n", > "module_stdout": "", > "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", > "rc": 127 > } > > Installing python (2) of course fixes the issue. > > I've noticed that it seems to be hardcoded as such in quite a few > modules: > > # grep -r '/usr/bin/python$' /usr/lib/python3/dist-packages/ansible | wc > -l > 2083 > > but I've also checked that in sid the original command is working, while > those files still have an hardcoded python2 executable, so I'm not sure > what is going on there. > > -- System Information: > Debian Release: bullseye/sid > APT prefers stable-updates > APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable'), (1, > 'experimental') > Architecture: amd64 (x86_64) > > Kernel: Linux 5.6.0-1-amd64 (SMP w/2 CPU cores) > Kernel taint flags: TAINT_FIRMWARE_WORKAROUND > Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8), > LANGUAGE=en_IE:en (charmap=UTF-8) > Shell: /bin/sh linked to /bin/dash > Init: systemd (via /run/systemd/system) > LSM: AppArmor: enabled > > Versions of packages ansible depends on: > ii openssh-client 1:8.2p1-4 > ii python3 3.8.2-3 > ii python3-crypto 2.6.1-13.1+b1 > ii python3-cryptography 2.8-4 > ii python3-distutils 3.8.2-2 > ii python3-dnspython 1.16.0-2 > ii python3-httplib2 0.14.0-3 > ii python3-jinja2 2.10.1-2 > ii python3-netaddr 0.7.19-4 > ii python3-paramiko 2.6.0-2 > ii python3-yaml 5.3.1-1+b1 > > Versions of packages ansible recommends: > ii python3-argcomplete 1.8.1-1.3 > ii python3-jmespath 0.9.5-1 > ii python3-kerberos 1.1.14-3.1+b1 > ii python3-libcloud 2.8.0-1 > ii python3-selinux 3.0-1+b3 > ii python3-winrm 0.3.0-2 > ii python3-xmltodict 0.12.0-2 > > Versions of packages ansible suggests: > ii cowsay 3.03+dfsg2-7 > ii sshpass 1.06-1+b1 > > -- no debconf information >