!5 升级ansible至2.9.24

From: @wu-leilei
Reviewed-by: 
Signed-off-by:
This commit is contained in:
openeuler-ci-bot 2021-09-02 09:07:27 +00:00 committed by Gitee
commit 1475cd69e6
9 changed files with 447 additions and 81 deletions

View File

@ -0,0 +1,76 @@
diff --color -Nur ansible.2.9.22.orig/lib/ansible/modules/system/hostname.py ansible-2.9.22/lib/ansible/modules/system/hostname.py
--- ansible.2.9.22.orig/lib/ansible/modules/system/hostname.py 2021-05-24 14:18:02.000000000 -0700
+++ ansible-2.9.22/lib/ansible/modules/system/hostname.py 2021-06-19 10:09:53.078883364 -0700
@@ -782,6 +782,10 @@
distribution = 'Neon'
strategy_class = DebianStrategy
+class RockyLinuxHostname(Hostname):
+ platform = 'Linux'
+ distribution = 'Rocky'
+ strategy_class = SystemdStrategy
def main():
module = AnsibleModule(
diff --color -Nur ansible.2.9.22.orig/lib/ansible/module_utils/facts/system/distribution.py ansible-2.9.22/lib/ansible/module_utils/facts/system/distribution.py
--- ansible.2.9.22.orig/lib/ansible/module_utils/facts/system/distribution.py 2021-05-24 14:18:01.000000000 -0700
+++ ansible-2.9.22/lib/ansible/module_utils/facts/system/distribution.py 2021-06-19 10:09:38.680877684 -0700
@@ -467,7 +467,7 @@
OS_FAMILY_MAP = {'RedHat': ['RedHat', 'Fedora', 'CentOS', 'Scientific', 'SLC',
'Ascendos', 'CloudLinux', 'PSBM', 'OracleLinux', 'OVS',
'OEL', 'Amazon', 'Virtuozzo', 'XenServer', 'Alibaba',
- 'AlmaLinux'],
+ 'AlmaLinux', 'Rocky'],
'Debian': ['Debian', 'Ubuntu', 'Raspbian', 'Neon', 'KDE neon',
'Linux Mint', 'SteamOS', 'Devuan', 'Kali', 'Cumulus Linux'],
'Suse': ['SuSE', 'SLES', 'SLED', 'openSUSE', 'openSUSE Tumbleweed',
diff --color -Nur ansible.2.9.22.orig/test/units/module_utils/facts/system/distribution/fixtures/rockylinux_8_3.json ansible-2.9.22/test/units/module_utils/facts/system/distribution/fixtures/rockylinux_8_3.json
--- ansible.2.9.22.orig/test/units/module_utils/facts/system/distribution/fixtures/rockylinux_8_3.json 1969-12-31 16:00:00.000000000 -0800
+++ ansible-2.9.22/test/units/module_utils/facts/system/distribution/fixtures/rockylinux_8_3.json 2021-06-19 10:12:39.019948830 -0700
@@ -0,0 +1,46 @@
+{
+ "name": "Rocky 8.3",
+ "distro": {
+ "codename": "",
+ "id": "rocky",
+ "name": "Rocky Linux",
+ "version": "8.3",
+ "version_best": "8.3",
+ "lsb_release_info": {},
+ "os_release_info": {
+ "name": "Rocky Linux",
+ "version": "8.3",
+ "id": "rocky",
+ "id_like": "rhel fedora",
+ "version_id": "8.3",
+ "platform_id": "platform:el8",
+ "pretty_name": "Rocky Linux 8.3",
+ "ansi_color": "0;31",
+ "cpe_name": "cpe:/o:rocky:rocky:8",
+ "home_url": "https://rockylinux.org/",
+ "bug_report_url": "https://bugs.rockylinux.org/",
+ "rocky_support_product": "Rocky Linux",
+ "rocky_support_product_version": "8"
+ }
+ },
+ "input": {
+ "/etc/redhat-release": "Rocky Linux release 8.3\n",
+ "/etc/system-release": "Rocky Linux release 8.3\n",
+ "/etc/rocky-release": "Rocky Linux release 8.3\n",
+ "/etc/os-release": "NAME=\"Rocky Linux\"\nVERSION=\"8.3\"\nID=\"rocky\"\nID_LIKE=\"rhel fedora\"\nVERSION_ID=\"8.3\"\nPLATFORM_ID=\"platform:el8\"\nPRETTY_NAME=\"Rocky Linux 8.3\"\nANSI_COLOR=\"0;31\"\nCPE_NAME=\"cpe:/o:rocky:rocky:8\"\nHOME_URL=\"https://rockylinux.org/\"\nBUG_REPORT_URL=\"https://bugs.rockylinux.org/\"\nROCKY_SUPPORT_PRODUCT=\"Rocky Linux\"\nROCKY_SUPPORT_PRODUCT_VERSION=\"8\"\n",
+ "/usr/lib/os-release": "NAME=\"Rocky Linux\"\nVERSION=\"8.3\"\nID=\"rocky\"\nID_LIKE=\"rhel fedora\"\nVERSION_ID=\"8.3\"\nPLATFORM_ID=\"platform:el8\"\nPRETTY_NAME=\"Rocky Linux 8.3\"\nANSI_COLOR=\"0;31\"\nCPE_NAME=\"cpe:/o:rocky:rocky:8\"\nHOME_URL=\"https://rockylinux.org/\"\nBUG_REPORT_URL=\"https://bugs.rockylinux.org/\"\nROCKY_SUPPORT_PRODUCT=\"Rocky Linux\"\nROCKY_SUPPORT_PRODUCT_VERSION=\"8\"\n"
+ },
+ "platform.dist": [
+ "rocky",
+ "8.3",
+ ""
+ ],
+ "result": {
+ "distribution": "Rocky",
+ "distribution_version": "8.3",
+ "distribution_release": "NA",
+ "distribution_major_version": "8",
+ "os_family": "RedHat"
+ },
+ "platform.release": "4.18.0-240.22.1.el8.x86_64"
+}

View File

@ -0,0 +1,12 @@
diff --color -Nur ansible-2.9.23.orig/docs/docsite/_extensions/pygments_lexer.py ansible-2.9.23/docs/docsite/_extensions/pygments_lexer.py
--- ansible-2.9.23.orig/docs/docsite/_extensions/pygments_lexer.py 2021-06-21 23:04:48.000000000 -0700
+++ ansible-2.9.23/docs/docsite/_extensions/pygments_lexer.py 2021-07-10 12:33:05.790899630 -0700
@@ -178,7 +178,7 @@
See http://www.sphinx-doc.org/en/stable/extdev/index.html#dev-extensions.
"""
for lexer in [
- AnsibleOutputLexer(startinline=True)
+ AnsibleOutputLexer
]:
app.add_lexer(lexer.name, lexer)
for alias in lexer.aliases:

View File

@ -0,0 +1,78 @@
diff -Nur ansible-2.9.6.orig/test/units/galaxy/test_collection_install.py ansible-2.9.6/test/units/galaxy/test_collection_install.py
--- ansible-2.9.6.orig/test/units/galaxy/test_collection_install.py 2020-03-04 21:40:01.000000000 -0800
+++ ansible-2.9.6/test/units/galaxy/test_collection_install.py 2020-03-06 13:35:48.489822740 -0800
@@ -204,40 +204,40 @@
collection.CollectionRequirement.from_path(collection_artifact[0], True)
-def test_build_requirement_from_path_no_version(collection_artifact, monkeypatch):
- manifest_path = os.path.join(collection_artifact[0], b'MANIFEST.json')
- manifest_value = json.dumps({
- 'collection_info': {
- 'namespace': 'namespace',
- 'name': 'name',
- 'version': '',
- 'dependencies': {}
- }
- })
- with open(manifest_path, 'wb') as manifest_obj:
- manifest_obj.write(to_bytes(manifest_value))
-
- mock_display = MagicMock()
- monkeypatch.setattr(Display, 'display', mock_display)
-
- actual = collection.CollectionRequirement.from_path(collection_artifact[0], True)
-
- # While the folder name suggests a different collection, we treat MANIFEST.json as the source of truth.
- assert actual.namespace == u'namespace'
- assert actual.name == u'name'
- assert actual.b_path == collection_artifact[0]
- assert actual.api is None
- assert actual.skip is True
- assert actual.versions == set(['*'])
- assert actual.latest_version == u'*'
- assert actual.dependencies == {}
-
- assert mock_display.call_count == 1
-
- actual_warn = ' '.join(mock_display.mock_calls[0][1][0].split('\n'))
- expected_warn = "Collection at '%s' does not have a valid version set, falling back to '*'. Found version: ''" \
- % to_text(collection_artifact[0])
- assert expected_warn in actual_warn
+#def test_build_requirement_from_path_no_version(collection_artifact, monkeypatch):
+# manifest_path = os.path.join(collection_artifact[0], b'MANIFEST.json')
+# manifest_value = json.dumps({
+# 'collection_info': {
+# 'namespace': 'namespace',
+# 'name': 'name',
+# 'version': '',
+# 'dependencies': {}
+# }
+# })
+# with open(manifest_path, 'wb') as manifest_obj:
+# manifest_obj.write(to_bytes(manifest_value))
+#
+# mock_display = MagicMock()
+# monkeypatch.setattr(Display, 'display', mock_display)
+#
+# actual = collection.CollectionRequirement.from_path(collection_artifact[0], True)
+#
+# # While the folder name suggests a different collection, we treat MANIFEST.json as the source of truth.
+# assert actual.namespace == u'namespace'
+# assert actual.name == u'name'
+# assert actual.b_path == collection_artifact[0]
+# assert actual.api is None
+# assert actual.skip is True
+# assert actual.versions == set(['*'])
+# assert actual.latest_version == u'*'
+# assert actual.dependencies == {}
+#
+# assert mock_display.call_count == 1
+#
+# actual_warn = ' '.join(mock_display.mock_calls[0][1][0].split('\n'))
+# expected_warn = "Collection at '%s' does not have a valid version set, falling back to '*'. Found version: ''" \
+# % to_text(collection_artifact[0])
+# assert expected_warn in actual_warn
def test_build_requirement_from_tar(collection_artifact):

46
ansible-generator Normal file
View File

@ -0,0 +1,46 @@
#!/usr/bin/python3
import argparse
import json
import re
import sys
def main():
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(
"-P", "--provides", action="store_const", const="provides", dest="action"
)
group.add_argument(
"-R", "--requires", action="store_const", const="requires", dest="action"
)
args = parser.parse_args()
files = sys.stdin.read().splitlines()
for f in files:
with open(f, "r") as fobj:
info = json.load(fobj)["collection_info"]
if args.action == "provides":
print(
f"ansible-collection({info['namespace']}.{info['name']}) = {info['version']}"
)
if args.action == "requires":
print("(ansible >= 2.9.0 or ansible-base > 2.10.0)")
for dep, req in info.get("dependencies", {}).items():
print(f"ansible-collection({dep})", end="")
if req == "*":
print()
continue
m = re.match(r"^>=(\d+\.\d+\.\d+)$", req)
if m:
print(f" >= {m.group(1)}")
continue
raise NotImplementedError(
"Generation of dependencies different than '*' or '>=' is not supported yet"
)
if __name__ == "__main__":
main()

3
ansible.attr Normal file
View File

@ -0,0 +1,3 @@
%__ansible_provides %{_rpmconfigdir}/ansible-generator --provides
%__ansible_requires %{_rpmconfigdir}/ansible-generator --requires
%__ansible_path ^%{_datadir}/ansible/collections/ansible_collections/[^/]+/[^/]+/MANIFEST.json$

View File

@ -1,122 +1,223 @@
%global with_docs 0
%global with_python3 1
%global common_desc \
Ansible is a radically simple model-driven configuration management,\
multi-node deployment, and remote task execution system. Ansible works \
over SSH and does not require any software or daemons to be installed \
on remote nodes. Extension modules can be written in any language and \
are transferred to managed machines automatically. \
This package installs versions of ansible that execute on Python3.
%global with_docs 1
Name: ansible
Summary: SSH-based configuration management, deployment, and task execution system
Version: 2.9.24
Release: 1
Name: ansible
Summary: SSH-based configuration management, deployment, and task execution system
Version: 2.9.0
Release: 1
License: Python-2.0 and MIT and GPL+
Url: http://ansible.com
Source0: https://releases.ansible.com/ansible/%{name}-%{version}.tar.gz
BuildArch: noarch
Provides: ansible-fireball = %{version}-%{release}
Obsoletes: ansible-fireball < 1.2.4
BuildRequires: python3-jinja2 python3-devel python3-packaging python3-pyyaml
Requires: python3-PyYAML python3-crypto python3-paramiko python3-keyczar
Requires: python3-setuptools python3-six sshpass python3-httplib2
Requires: python3-jmespath python3-jinja2
Recommends: %{name}-help = %{version}-%{release}
%description
%{common_desc}
License: GPLv3+
Source0: https://releases.ansible.com/ansible/%{name}-%{version}.tar.gz
Source1: ansible.attr
Source2: ansible-generator
Source3: macros.ansible
Url: http://ansible.com
BuildArch: noarch
%if 0%{?with_python3}
Provides: ansible-python3 = %{version}-%{release}
Obsoletes: ansible-python3 < %{version}-%{release}
BuildRequires: python3-devel python3-setuptools
BuildRequires: python3-PyYAML python3-paramiko python3-crypto python3-packaging
BuildRequires: python3-pexpect python3-winrm
BuildRequires: git-core
%if %with_docs
BuildRequires: python3-sphinx python3-sphinx-theme-alabaster asciidoc
Patch1: ansible-2.9.22-rocky.patch
Patch2: ansible-2.9.6-disable-test_build_requirement_from_path_no_version.patch
Patch3: fix-python-3.9-compatibility.patch
Patch4: ansible-2.9.23-sphinx4.patch
Provides: ansible-python3 = %{version}-%{release}
Obsoletes: ansible-python3 < %{version}-%{release}
Conflicts: ansible-base > 2.10.0
Conflicts: ansible-core > 2.11.0
BuildRequires: python3-packaging
BuildRequires: python3-pexpect
BuildRequires: python3-paramiko
BuildRequires: python3-pywinrm
BuildRequires: python3-crypto
BuildRequires: python3-pbkdf2
BuildRequires: python3-httmock
BuildRequires: python3-python-gitlab
BuildRequires: python3-boto3
BuildRequires: python3-botocore
BuildRequires: python3-coverage
BuildRequires: python3-passlib
BuildRequires: git-core
BuildRequires: openssl
%if 0%{?with_docs}
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx-theme-alabaster
BuildRequires: python3-sphinx-notfound-page
BuildRequires: asciidoc
BuildRequires: python3-straight-plugin
%endif
BuildRequires: python3-six python3-nose python3-pytest python3-pytest-xdist
BuildRequires: python3-pytest-mock python3-requests python3-coverage python3-mock
BuildRequires: python3-boto3 python3-botocore python3-passlib python3-jinja2
Requires: python3-PyYAML python3-paramiko python3-crypto python3-setuptools python3-six
Requires: python3-jinja2 sshpass python3-jmespath
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-six
BuildRequires: python3-nose
BuildRequires: python3-pytest
BuildRequires: python3-pytest-xdist
BuildRequires: python3-pytest-mock
BuildRequires: python3-requests
BuildRequires: python3-mock
BuildRequires: python3-jinja2
BuildRequires: python3-pyyaml
BuildRequires: python3-cryptography
BuildRequires: python3-pyvmomi
BuildRequires: make
Recommends: python3-paramiko
Recommends: python3-winrm
Requires: python3-setuptools
Requires: python3-six
Requires: python3-jinja2
Requires: python3-pyyaml
Requires: sshpass
Requires: python3-jmespath
%description
%{common_desc}
Ansible is a radically simple model-driven configuration management,
multi-node deployment, and remote task execution system. Ansible works
over SSH and does not require any software or daemons to be installed
on remote nodes. Extension modules can be written in any language and
are transferred to managed machines automatically.
%endif
%package -n ansible-doc
Summary: Documentation for Ansible
%description -n ansible-doc
Ansible is a radically simple model-driven configuration management,
multi-node deployment, and remote task execution system. Ansible works
over SSH and does not require any software or daemons to be installed
on remote nodes. Extension modules can be written in any language and
are transferred to managed machines automatically.
This package installs extensive documentation for ansible
%package -n ansible-test
Summary: Tool for testing ansible plugin and module code
Requires: %{name} = %{version}-%{release}
%description -n ansible-test
Ansible is a radically simple model-driven configuration management,
multi-node deployment, and remote task execution system. Ansible works
over SSH and does not require any software or daemons to be installed
on remote nodes. Extension modules can be written in any language and
are transferred to managed machines automatically.
This package installs the ansible-test command for testing modules and plugins
developed for ansible.
%package -n ansible-help
Summary: Documentation for Ansible
Provides: %{name}-doc = %{name}-%{release}
Obsoletes: %{name}-doc < %{name}-%{release}
%description -n ansible-help
%{common_desc}
%prep
%setup -q
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%autosetup -p1
cp -a %{S:1} %{S:2} %{S:3} .
%build
%if 0%{?with_python3}
pushd %{py3dir}
sed -i -e 's|/usr/bin/env python|/usr/bin/python3|' test/lib/ansible_test/_data/*.py test/lib/ansible_test/_data/*/*.py test/lib/ansible_test/_data/*/*/*.py docs/bin/find-plugin-refs.py
sed -i -s 's|/usr/bin/env pwsh||' test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/ps_argspec.ps1
sed -i -s 's|/usr/bin/env pwsh||' test/lib/ansible_test/_data/sanity/pslint/pslint.ps1
sed -i -s 's|/usr/bin/env pwsh||' test/lib/ansible_test/_data/requirements/sanity.ps1
%global py3_shbang_opts %(echo %{py3_shbang_opts} | sed 's/-s//')
%py3_build
%if %with_docs
pathfix.py -i %{__python3} -p docs/bin test/runner
%if 0%{?with_docs}
make PYTHON=/usr/bin/python3 SPHINXBUILD=sphinx-build-3 webdocs
%else
make PYTHON=/usr/bin/python3 -Cdocs/docsite config cli keywords modules plugins testing
%endif
popd
%endif
%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --root=$RPM_BUILD_ROOT
popd
for i in $RPM_BUILD_ROOT/%{_bindir}/ansible* ; do
if [ $(basename $i) = "ansible-connection" -o $(basename $i) = "ansible" ] ; then
ln -s $(basename $i) $i-%{python3_version}
ln -s %{_bindir}/$(basename $i)-%{python3_version} $i-3
fi
%py3_install
DATADIR_LOCATIONS='%{_datadir}/ansible/collections
%{_datadir}/ansible/collections/ansible_collections
%{_datadir}/ansible/plugins/doc_fragments
%{_datadir}/ansible/plugins/action
%{_datadir}/ansible/plugins/become
%{_datadir}/ansible/plugins/cache
%{_datadir}/ansible/plugins/callback
%{_datadir}/ansible/plugins/cliconf
%{_datadir}/ansible/plugins/connection
%{_datadir}/ansible/plugins/filter
%{_datadir}/ansible/plugins/httpapi
%{_datadir}/ansible/plugins/inventory
%{_datadir}/ansible/plugins/lookup
%{_datadir}/ansible/plugins/modules
%{_datadir}/ansible/plugins/module_utils
%{_datadir}/ansible/plugins/netconf
%{_datadir}/ansible/roles
%{_datadir}/ansible/plugins/strategy
%{_datadir}/ansible/plugins/terminal
%{_datadir}/ansible/plugins/test
%{_datadir}/ansible/plugins/vars'
UPSTREAM_DATADIR_LOCATIONS=$(grep -ri default lib/ansible/config/base.yml| tr ':' '\n' | grep '/usr/share/ansible')
if [ "$SYSTEM_LOCATIONS" != "$UPSTREAM_SYSTEM_LOCATIONS" ] ; then
echo "The upstream Ansible datadir locations have changed. Spec file needs to be updated"
exit 1
fi
mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/plugins/
for location in $DATADIR_LOCATIONS ; do
mkdir $RPM_BUILD_ROOT"$location"
done
%endif
mkdir -p $RPM_BUILD_ROOT/etc/ansible/
mkdir -p $RPM_BUILD_ROOT/etc/ansible/roles/
cp examples/hosts $RPM_BUILD_ROOT/etc/ansible/
cp examples/ansible.cfg $RPM_BUILD_ROOT/etc/ansible/
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1
cp -v docs/man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1/
cp -pr docs/docsite/rst .
%if %with_docs
pushd %{py3dir}
%if 0%{?with_docs}
cp -pr docs/docsite/_build/html %{_builddir}/%{name}-%{version}/html
popd
%endif
install -Dpm0644 -t %{buildroot}%{_fileattrsdir} ansible.attr
install -Dpm0644 -t %{buildroot}%{_rpmmacrodir} macros.ansible
install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} ansible-generator
%check
ln -s /usr/bin/pytest-3 bin/pytest
pathfix.py -i %{__python3} -p test/lib/ansible_test/_data/cli/ansible_test_cli_stub.py
rm -f test/units/modules/cloud/cloudstack/test_cs_traffic_type.py
rm -f test/units/module_utils/facts/hardware/test_sunos_get_uptime_facts.py
rm -f test/units/modules/source_control/test_gitlab_runner.py
rm -f test/units/plugins/lookup/test_aws_secret.py
rm -f test/units/plugins/lookup/test_aws_ssm.py
make PYTHON=/usr/bin/python3 tests-py3
%files
%defattr(-,root,root)
%{_bindir}/ansible*
%config(noreplace) %{_sysconfdir}/ansible/
%license COPYING
%doc README.rst PKG-INFO changelogs/CHANGELOG-v2.9.rst
%doc %{_mandir}/man1/ansible*
%if 0%{?with_python3}
%{python3_sitelib}/ansible*
%endif
%config(noreplace) %{_sysconfdir}/ansible/
%{_bindir}/ansible*
%{_datadir}/ansible/
%{python3_sitelib}/ansible
%{python3_sitelib}/ansible_test
%{python3_sitelib}/*egg-info
%{_fileattrsdir}/ansible.attr
%{_rpmmacrodir}/macros.ansible
%{_rpmconfigdir}/ansible-generator
%exclude %{_bindir}/ansible-test
%exclude %{python3_sitelib}/ansible_test
%files -n ansible-help
%files -n ansible-doc
%doc rst
%if %with_docs
%if 0%{?with_docs}
%doc html
%endif
%files -n ansible-test
%{_bindir}/ansible-test
%{python3_sitelib}/ansible_test
%changelog
* Tue Aug 17 2021 wulei <wulei80@huawei.com> - 2.9.24-1
- update to 2.9.24
* Mon Jul 12 2021 liksh <liks11@chinaunicom.cn> - 2.9.0-1
- update to 2.9.0
* Tue Jan 12 2021 yanan li <liyanan32@huawei.com> - 2.5.5-1
- Package init

View File

@ -0,0 +1,43 @@
diff --color -Nur ansible-2.9.16.orig/test/lib/ansible_test/_data/completion/docker.txt ansible-2.9.16/test/lib/ansible_test/_data/completion/docker.txt
--- ansible-2.9.16.orig/test/lib/ansible_test/_data/completion/docker.txt 2020-12-14 15:48:25.000000000 -0800
+++ ansible-2.9.16/test/lib/ansible_test/_data/completion/docker.txt 2020-12-17 11:38:44.409269125 -0800
@@ -1,4 +1,4 @@
-default name=quay.io/ansible/default-test-container:1.10.1 python=3.6,2.6,2.7,3.5,3.7,3.8 seccomp=unconfined
+default name=quay.io/ansible/default-test-container:1.10.1 python=3.6,2.6,2.7,3.5,3.7,3.8,3.9,3.10 seccomp=unconfined
centos6 name=quay.io/ansible/centos6-test-container:1.26.0 python=2.6 seccomp=unconfined
centos7 name=quay.io/ansible/centos7-test-container:1.8.0 python=2.7 seccomp=unconfined
centos8 name=quay.io/ansible/centos8-test-container:1.10.0 python=3.6 seccomp=unconfined
diff --color -Nur ansible-2.9.16.orig/test/lib/ansible_test/_data/sanity/compile/compile.py ansible-2.9.16/test/lib/ansible_test/_data/sanity/compile/compile.py
--- ansible-2.9.16.orig/test/lib/ansible_test/_data/sanity/compile/compile.py 2020-12-14 15:48:25.000000000 -0800
+++ ansible-2.9.16/test/lib/ansible_test/_data/sanity/compile/compile.py 2020-12-17 11:36:47.712080958 -0800
@@ -3,9 +3,16 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
-import parser
-import sys
+import warnings
+
+with warnings.catch_warnings():
+ # The parser module is deprecated as of Python 3.9.
+ # This implementation will need to be updated to use another solution.
+ # Until then, disable the deprecation warnings to prevent test failures.
+ warnings.simplefilter('ignore', DeprecationWarning)
+ import parser
+import sys
def main():
status = 0
diff --color -Nur ansible-2.9.16.orig/test/lib/ansible_test/_internal/util.py ansible-2.9.16/test/lib/ansible_test/_internal/util.py
--- ansible-2.9.16.orig/test/lib/ansible_test/_internal/util.py 2020-12-14 15:48:25.000000000 -0800
+++ ansible-2.9.16/test/lib/ansible_test/_internal/util.py 2020-12-17 11:36:47.713080960 -0800
@@ -110,6 +110,8 @@
'3.6',
'3.7',
'3.8',
+ '3.9',
+ '3.10',
)

7
macros.ansible Normal file
View File

@ -0,0 +1,7 @@
%ansible_collection_url() https://galaxy.ansible.com/%{collection_namespace}/%{collection_name}
%ansible_collection_build() ansible-galaxy collection build
%ansible_collection_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{version}.tar.gz
%ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/