summaryrefslogtreecommitdiffstats
path: root/debian/patches
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 20:03:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 20:03:05 +0000
commitcb54f328515d55394b71e492ffbfefe5e6b0d891 (patch)
tree51ffbd301c8897ba0ff6c3d7be0e9d9cc98aee09 /debian/patches
parentAdding upstream version 2.10.7+merged+base+2.10.8+dfsg. (diff)
downloadansible-cb54f328515d55394b71e492ffbfefe5e6b0d891.tar.xz
ansible-cb54f328515d55394b71e492ffbfefe5e6b0d891.zip
Adding debian version 2.10.7+merged+base+2.10.8+dfsg-1.debian/2.10.7+merged+base+2.10.8+dfsg-1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--debian/patches/0001-fix-syntax-warnings.patch47
-rw-r--r--debian/patches/0003-preserve-debian-dir.patch16
-rw-r--r--debian/patches/0005-use-py3.patch650
-rw-r--r--debian/patches/0007-fix-interpreter-fallback.patch23
-rw-r--r--debian/patches/series4
5 files changed, 740 insertions, 0 deletions
diff --git a/debian/patches/0001-fix-syntax-warnings.patch b/debian/patches/0001-fix-syntax-warnings.patch
new file mode 100644
index 00000000..f043d04e
--- /dev/null
+++ b/debian/patches/0001-fix-syntax-warnings.patch
@@ -0,0 +1,47 @@
+Description: Fix syntax warnings
+ There are four SyntaxWarning when installing the Debian package, fix those.
+Author: Lee Garrett <debian@rocketjump.eu>
+Forwarded: not-needed
+Last-Update: 2021-03-24
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/collections-debian-merged/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationassignment.py
++++ b/collections-debian-merged/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationassignment.py
+@@ -230,7 +230,7 @@
+ response = old_response
+ self.results['state'] = response
+
+- if self.state is 'present':
++ if self.state == 'present':
+ if self.results['state'].get('properties', None) is not None:
+ registration_definition_id = self.results['state']['properties']['registration_definition_id']
+ self.results['state']['properties'].clear()
+--- a/collections-debian-merged/ansible_collections/cyberark/pas/plugins/modules/cyberark_account.py
++++ b/collections-debian-merged/ansible_collections/cyberark/pas/plugins/modules/cyberark_account.py
+@@ -531,7 +531,7 @@
+ logging.debug(
+ ("child_module_parm_value: %s "
+ "child_existing_account_value=%s path=%s")
+- (
++ % (
+ child_module_parm_value,
+ child_existing_account_value,
+ path_value,
+@@ -571,7 +571,7 @@
+ )
+ logging.debug(
+ "parameter_name=%s value=%s existing=%s"
+- (
++ % (
+ path_value,
+ child_module_parm_value,
+ child_existing_account_value,
+@@ -632,7 +632,7 @@
+ )
+ logging.debug(
+ "parameter_name=%s value=%s existing=%s"
+- (
++ % (
+ parameter_name, module_parm_value,
+ existing_account_value
+ )
diff --git a/debian/patches/0003-preserve-debian-dir.patch b/debian/patches/0003-preserve-debian-dir.patch
new file mode 100644
index 00000000..27c193bb
--- /dev/null
+++ b/debian/patches/0003-preserve-debian-dir.patch
@@ -0,0 +1,16 @@
+Description: Prevent makefile from deleting debian/
+Author: Harlan Lieberman-Berg <hlieberman@debian.org>
+Forwarded: not-neededIndex: ansible/Makefile
+===================================================================
+--- a/Makefile
++++ b/Makefile
+@@ -154,9 +154,6 @@
+ rm -f test/units/.coverage*
+ rm -rf test/results/*/*
+ find test/ -type f -name '*.retry' -delete
+- @echo "Cleaning up Debian building stuff"
+- rm -rf debian
+- rm -rf deb-build
+ rm -rf docs/json
+ rm -rf docs/js
+ @echo "Cleaning up docsite"
diff --git a/debian/patches/0005-use-py3.patch b/debian/patches/0005-use-py3.patch
new file mode 100644
index 00000000..35c9f422
--- /dev/null
+++ b/debian/patches/0005-use-py3.patch
@@ -0,0 +1,650 @@
+Description: use py3
+ Use python 3 for all helper scripts during build
+ .
+ This allows us to not depend on python 2 anymore for building.
+--- a/docs/bin/find-plugin-refs.py
++++ b/docs/bin/find-plugin-refs.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # To run this script, first make webdocs in the toplevel of the checkout. This will generate all
+ # rst files from their sources. Then run this script ./docs/bin/find-plugin-refs.py
+--- a/Makefile
++++ b/Makefile
+@@ -31,7 +31,7 @@
+ ASCII2MAN = @echo "ERROR: rst2man from docutils command is not installed but is required to build $(MANPAGES)" && exit 1
+ endif
+
+-PYTHON=python
++PYTHON=python3
+ GENERATE_CLI = hacking/build-ansible.py generate-man
+
+ # fetch version from project release.py as single source-of-truth
+--- a/lib/ansible/cli/scripts/ansible_cli_stub.py
++++ b/lib/ansible/cli/scripts/ansible_cli_stub.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+ # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
+ #
+--- a/lib/ansible/cli/scripts/ansible_connection_cli_stub.py
++++ b/lib/ansible/cli/scripts/ansible_connection_cli_stub.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright: (c) 2017, Ansible Project
+ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+ from __future__ import (absolute_import, division, print_function)
+--- a/packaging/sdist/check-link-behavior.py
++++ b/packaging/sdist/check-link-behavior.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Checks for link behavior required for sdist to retain symlinks."""
+
+ from __future__ import (absolute_import, division, print_function)
+--- a/test/integration/targets/cli/test-cli.py
++++ b/test/integration/targets/cli/test-cli.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (c) 2019 Matt Martz <matt@sivel.net>
+ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+--- a/test/integration/targets/gathering/uuid.fact
++++ b/test/integration/targets/gathering/uuid.fact
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+
+
+--- a/test/integration/targets/gathering_facts/uuid.fact
++++ b/test/integration/targets/gathering_facts/uuid.fact
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+
+
+--- a/test/integration/targets/group/files/gidget.py
++++ b/test/integration/targets/group/files/gidget.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ import grp
+
+--- a/test/integration/targets/module_utils/module_utils/foo.py
++++ b/test/integration/targets/module_utils/module_utils/foo.py
+@@ -1,3 +1,3 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ foo = "FOO FROM foo.py"
+--- a/test/integration/targets/module_utils/module_utils/sub/bam.py
++++ b/test/integration/targets/module_utils/module_utils/sub/bam.py
+@@ -1,3 +1,3 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ bam = "BAM FROM sub/bam.py"
+--- a/test/integration/targets/module_utils/module_utils/sub/bam/bam.py
++++ b/test/integration/targets/module_utils/module_utils/sub/bam/bam.py
+@@ -1,3 +1,3 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ bam = "BAM FROM sub/bam/bam.py"
+--- a/test/integration/targets/module_utils/module_utils/sub/bar/bam.py
++++ b/test/integration/targets/module_utils/module_utils/sub/bar/bam.py
+@@ -1,3 +1,3 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ bam = "BAM FROM sub/bar/bam.py"
+--- a/test/integration/targets/module_utils/module_utils/sub/bar/bar.py
++++ b/test/integration/targets/module_utils/module_utils/sub/bar/bar.py
+@@ -1,3 +1,3 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ bar = "BAR FROM sub/bar/bar.py"
+--- a/test/integration/targets/pause/test-pause.py
++++ b/test/integration/targets/pause/test-pause.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ import os
+ import pexpect
+--- a/test/integration/targets/pip/files/setup.py
++++ b/test/integration/targets/pip/files/setup.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ from setuptools import setup, find_packages
+
+--- a/test/integration/targets/service/files/ansible_test_service.py
++++ b/test/integration/targets/service/files/ansible_test_service.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # this is mostly based off of the code found here:
+ # http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/
+--- a/test/integration/targets/setup_rpm_repo/files/create-repo.py
++++ b/test/integration/targets/setup_rpm_repo/files/create-repo.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+
+ import sys
+--- a/test/integration/targets/template/role_filter/filter_plugins/myplugin.py
++++ b/test/integration/targets/template/role_filter/filter_plugins/myplugin.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+
+ class FilterModule(object):
+--- a/test/integration/targets/throttle/test_throttle.py
++++ b/test/integration/targets/throttle/test_throttle.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/integration/targets/var_precedence/ansible-var-precedence-check.py
++++ b/test/integration/targets/var_precedence/ansible-var-precedence-check.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # A tool to check the order of precedence for ansible variables
+ # https://github.com/ansible/ansible/blob/devel/test/integration/test_var_precedence.yml
+--- a/test/integration/targets/vault/faux-editor.py
++++ b/test/integration/targets/vault/faux-editor.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # Ansible is free software: you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+--- a/test/integration/targets/vault/password-script.py
++++ b/test/integration/targets/vault/password-script.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # Ansible is free software: you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+--- a/test/integration/targets/vault/test-vault-client.py
++++ b/test/integration/targets/vault/test-vault-client.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+
+ ANSIBLE_METADATA = {'status': ['preview'],
+--- a/test/lib/ansible_test/_data/cli/ansible_test_cli_stub.py
++++ b/test/lib/ansible_test/_data/cli/ansible_test_cli_stub.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # PYTHON_ARGCOMPLETE_OK
+ """Command line entry point for ansible-test."""
+
+--- a/test/lib/ansible_test/_data/injector/python.py
++++ b/test/lib/ansible_test/_data/injector/python.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Provides an entry point for python scripts and python modules on the controller with the current python interpreter and optional code coverage collection."""
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/lib/ansible_test/_data/sanity/code-smell/action-plugin-docs.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/action-plugin-docs.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Test to verify action plugins have an associated module to provide documentation."""
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/lib/ansible_test/_data/sanity/code-smell/empty-init.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/empty-init.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/future-import-boilerplate.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/future-import-boilerplate.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/line-endings.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/line-endings.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/metaclass-boilerplate.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/metaclass-boilerplate.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/no-assert.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/no-assert.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/no-basestring.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/no-basestring.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/no-dict-iteritems.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/no-dict-iteritems.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/no-dict-iterkeys.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/no-dict-iterkeys.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/no-dict-itervalues.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/no-dict-itervalues.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/no-get-exception.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/no-get-exception.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/no-illegal-filenames.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/no-illegal-filenames.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # a script to check for illegal filenames on various Operating Systems. The
+ # main rules are derived from restrictions on Windows
+--- a/test/lib/ansible_test/_data/sanity/code-smell/no-main-display.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/no-main-display.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/no-smart-quotes.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/no-smart-quotes.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/lib/ansible_test/_data/sanity/code-smell/no-unicode-literals.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/no-unicode-literals.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/replace-urlopen.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/replace-urlopen.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/shebang.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/shebang.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python33
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+@@ -16,14 +16,14 @@
+ b'#!/usr/bin/env bash',
+ b'#!/usr/bin/env fish',
+ b'#!/usr/bin/env pwsh',
+- b'#!/usr/bin/env python',
++ b'#!/usr/bin/env python3',
+ b'#!/usr/bin/make -f',
+ ])
+
+ integration_shebangs = set([
+ b'#!/bin/sh',
+ b'#!/usr/bin/env bash',
+- b'#!/usr/bin/env python',
++ b'#!/usr/bin/env python3',
+ ])
+
+ module_shebangs = {
+--- a/test/lib/ansible_test/_data/sanity/code-smell/symlinks.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/symlinks.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/use-argspec-type-path.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/use-argspec-type-path.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/use-compat-six.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/use-compat-six.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/compile/compile.py
++++ b/test/lib/ansible_test/_data/sanity/compile/compile.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Python syntax checker with lint friendly output."""
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/lib/ansible_test/_data/sanity/import/importer.py
++++ b/test/lib/ansible_test/_data/sanity/import/importer.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Import the given python module(s) and report error(s) encountered."""
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/lib/ansible_test/_data/sanity/validate-modules/main.py
++++ b/test/lib/ansible_test/_data/sanity/validate-modules/main.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/yamllint/yamllinter.py
++++ b/test/lib/ansible_test/_data/sanity/yamllint/yamllinter.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Wrapper around yamllint that supports YAML embedded in Ansible modules."""
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/lib/ansible_test/_data/versions.py
++++ b/test/lib/ansible_test/_data/versions.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Show python and pip versions."""
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/lib/ansible_test/_data/virtualenvcheck.py
++++ b/test/lib/ansible_test/_data/virtualenvcheck.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Detect the real python interpreter when running in a virtual environment created by the 'virtualenv' module."""
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/lib/ansible_test/_data/yamlcheck.py
++++ b/test/lib/ansible_test/_data/yamlcheck.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Show python and pip versions."""
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/sanity/code-smell/configure-remoting-ps1.py
++++ b/test/sanity/code-smell/configure-remoting-ps1.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/sanity/code-smell/deprecated-config.py
++++ b/test/sanity/code-smell/deprecated-config.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+ # (c) 2018, Matt Martz <matt@sivel.net>
+ #
+--- a/test/sanity/code-smell/docs-build.py
++++ b/test/sanity/code-smell/docs-build.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/sanity/code-smell/no-unwanted-files.py
++++ b/test/sanity/code-smell/no-unwanted-files.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Prevent unwanted files from being added to the source tree."""
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/sanity/code-smell/obsolete-files.py
++++ b/test/sanity/code-smell/obsolete-files.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Prevent files from being added to directories that are now obsolete."""
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/sanity/code-smell/package-data.py
++++ b/test/sanity/code-smell/package-data.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/sanity/code-smell/required-and-default-attributes.py
++++ b/test/sanity/code-smell/required-and-default-attributes.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/sanity/code-smell/test-constraints.py
++++ b/test/sanity/code-smell/test-constraints.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/sanity/code-smell/update-bundled.py
++++ b/test/sanity/code-smell/update-bundled.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+ # (c) 2018, Ansible Project
+ #
+--- a/test/integration/targets/ansible-galaxy-collection/files/build_bad_tar.py
++++ b/test/integration/targets/ansible-galaxy-collection/files/build_bad_tar.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # Copyright: (c) 2020, Ansible Project
+ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+--- a/test/integration/targets/builtin_vars_prompt/test-vars_prompt.py
++++ b/test/integration/targets/builtin_vars_prompt/test-vars_prompt.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ import os
+ import pexpect
+--- a/test/integration/targets/cli/test_k_and_K.py
++++ b/test/integration/targets/cli/test_k_and_K.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+ # Make coding more python3-ish
+--- a/test/integration/targets/service_facts/files/ansible_test_service.py
++++ b/test/integration/targets/service_facts/files/ansible_test_service.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # this is mostly based off of the code found here:
+ # http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/
+--- a/test/lib/ansible_test/_data/sanity/code-smell/changelog.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/changelog.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+
+--- a/test/lib/ansible_test/_data/sanity/code-smell/runtime-metadata.py
++++ b/test/lib/ansible_test/_data/sanity/code-smell/runtime-metadata.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Schema validation of ansible-base's ansible_builtin_runtime.yml and collection's meta/runtime.yml"""
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/lib/ansible_test/_data/sslcheck.py
++++ b/test/lib/ansible_test/_data/sslcheck.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """Show openssl version."""
+ from __future__ import (absolute_import, division, print_function)
+ __metaclass__ = type
+--- a/test/sanity/code-smell/release-names.py
++++ b/test/sanity/code-smell/release-names.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+ # (c) 2019, Ansible Project
+ #
+--- a/test/integration/targets/blocks/runme.sh
++++ b/test/integration/targets/blocks/runme.sh
+@@ -9,7 +9,7 @@
+ rm -f block_test.out
+ # run the test and check to make sure the right number of completions was logged
+ ansible-playbook -vv main.yml -i ../../inventory | tee block_test.out
+-env python -c \
++env python3 -c \
+ 'import sys, re; sys.stdout.write(re.sub("\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "", sys.stdin.read()))' \
+ <block_test.out >block_test_wo_colors.out
+ [ "$(grep -c 'TEST COMPLETE' block_test.out)" = "$(grep -E '^[0-9]+ plays in' block_test_wo_colors.out | cut -f1 -d' ')" ]
+@@ -17,7 +17,7 @@
+ rm -f block_test.out block_test_wo_colors.out
+ # run test with free strategy and again count the completions
+ ansible-playbook -vv main.yml -i ../../inventory -e test_strategy=free | tee block_test.out
+-env python -c \
++env python3 -c \
+ 'import sys, re; sys.stdout.write(re.sub("\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "", sys.stdin.read()))' \
+ <block_test.out >block_test_wo_colors.out
+ [ "$(grep -c 'TEST COMPLETE' block_test.out)" = "$(grep -E '^[0-9]+ plays in' block_test_wo_colors.out | cut -f1 -d' ')" ]
+@@ -25,7 +25,7 @@
+ rm -f block_test.out block_test_wo_colors.out
+ # run test with host_pinned strategy and again count the completions
+ ansible-playbook -vv main.yml -i ../../inventory -e test_strategy=host_pinned | tee block_test.out
+-env python -c \
++env python3 -c \
+ 'import sys, re; sys.stdout.write(re.sub("\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "", sys.stdin.read()))' \
+ <block_test.out >block_test_wo_colors.out
+ [ "$(grep -c 'TEST COMPLETE' block_test.out)" = "$(grep -E '^[0-9]+ plays in' block_test_wo_colors.out | cut -f1 -d' ')" ]
+@@ -33,7 +33,7 @@
+ # run test that includes tasks that fail inside a block with always
+ rm -f block_test.out block_test_wo_colors.out
+ ansible-playbook -vv block_fail.yml -i ../../inventory | tee block_test.out
+-env python -c \
++env python3 -c \
+ 'import sys, re; sys.stdout.write(re.sub("\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "", sys.stdin.read()))' \
+ <block_test.out >block_test_wo_colors.out
+ [ "$(grep -c 'TEST COMPLETE' block_test.out)" = "$(grep -E '^[0-9]+ plays in' block_test_wo_colors.out | cut -f1 -d' ')" ]
+--- a/test/integration/targets/plugin_config_for_inventory/runme.sh
++++ b/test/integration/targets/plugin_config_for_inventory/runme.sh
+@@ -7,10 +7,10 @@
+
+ # check default values
+ ansible-inventory --list -i ./config_without_parameter.yml --export | \
+- env python -c "import json, sys; inv = json.loads(sys.stdin.read()); \
++ env python3 -c "import json, sys; inv = json.loads(sys.stdin.read()); \
+ assert set(inv['_meta']['hostvars']['test_host']['departments']) == set(['seine-et-marne', 'haute-garonne'])"
+
+ # check values
+ ansible-inventory --list -i ./config_with_parameter.yml --export | \
+- env python -c "import json, sys; inv = json.loads(sys.stdin.read()); \
++ env python3 -c "import json, sys; inv = json.loads(sys.stdin.read()); \
+ assert set(inv['_meta']['hostvars']['test_host']['departments']) == set(['paris'])"
+--- a/docs/docsite/Makefile
++++ b/docs/docsite/Makefile
+@@ -1,5 +1,5 @@
+ OS := $(shell uname -s)
+-SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"):
++SITELIB = $(shell python3 -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"):
+ PLUGIN_FORMATTER=../../hacking/build-ansible.py docs-build
+ TESTING_FORMATTER=../bin/testing_formatter.sh
+ KEYWORD_DUMPER=../../hacking/build-ansible.py document-keywords
+@@ -31,7 +31,7 @@
+ endif
+ endif
+
+-PYTHON=python
++PYTHON=python3
+ MAJOR_VERSION := $(shell $(PYTHON) ../../packaging/release/versionhelper/version_helper.py --majorversion || echo error)
+
+ ANSIBLE_VERSION_ARGS=
diff --git a/debian/patches/0007-fix-interpreter-fallback.patch b/debian/patches/0007-fix-interpreter-fallback.patch
new file mode 100644
index 00000000..34a3bd53
--- /dev/null
+++ b/debian/patches/0007-fix-interpreter-fallback.patch
@@ -0,0 +1,23 @@
+Description: Fix python interpreter discovery (Closes: #983140)
+ On machines upgrade from buster to bullseye, the wrong interpreter will be
+ discovered and used, causing the playbook run to fail. Update the fallback list
+ so it correctly picks python3.9 on bullseye when both 3.9 and 3.7 are present,
+ which usually is the case on freshly upgrade machines.
+Origin: backport, https://github.com/ansible/ansible/commit/c986cbb9961bfaedf1a6ae7f0c2e34be26d9ab12
+Forwarded: not-needed
+Applied-Upstream: https://github.com/ansible/ansible/commit/c986cbb9961bfaedf1a6ae7f0c2e34be26d9ab12
+Reviewed-by: Lee Garrett <debian@rocketjump.eu>
+Last-Update: 2021-03-23
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/lib/ansible/config/base.yml
++++ b/lib/ansible/config/base.yml
+@@ -1523,6 +1523,8 @@
+ name: Ordered list of Python interpreters to check for in discovery
+ default:
+ - /usr/bin/python
++ - python3.9
++ - python3.8
+ - python3.7
+ - python3.6
+ - python3.5
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 00000000..b880a37b
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,4 @@
+0001-fix-syntax-warnings.patch
+0003-preserve-debian-dir.patch
+0005-use-py3.patch
+0007-fix-interpreter-fallback.patch