diff --git a/changelogs/fragments/debian8_discovery.yml b/changelogs/fragments/debian8_discovery.yml new file mode 100644 index 00000000000..d502b24fe3f --- /dev/null +++ b/changelogs/fragments/debian8_discovery.yml @@ -0,0 +1,2 @@ +bugfixes: +- interpreter discovery - Debian 8 and lower will avoid unsupported Python3 version in interpreter discovery diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml index 1b088a1cd14..7f0fff9b55d 100644 --- a/lib/ansible/config/base.yml +++ b/lib/ansible/config/base.yml @@ -1482,6 +1482,7 @@ INTERPRETER_PYTHON_DISTRO_MAP: '6': /usr/bin/python '8': /usr/libexec/platform-python debian: + '8': /usr/bin/python '10': /usr/bin/python3 fedora: '23': /usr/bin/python3 diff --git a/test/integration/targets/interpreter_discovery_python/tasks/main.yml b/test/integration/targets/interpreter_discovery_python/tasks/main.yml index be15186fb28..b8bafd1511e 100644 --- a/test/integration/targets/interpreter_discovery_python/tasks/main.yml +++ b/test/integration/targets/interpreter_discovery_python/tasks/main.yml @@ -140,8 +140,11 @@ - name: debian assertions assert: that: - - auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python3' - when: distro == 'debian' and distro_version is version('10', '>=') + # Debian 8 and older + - auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python' and distro_version is version('8', '<=') or distro_version is version('8', '>') + # Debian 10 and newer + - auto_out.ansible_facts.discovered_interpreter_python == '/usr/bin/python3' and distro_version is version('10', '>=') or distro_version is version('10', '<') + when: distro == 'debian' - name: fedora assertions assert: