diff --git a/ansible-2.9.22-rocky.patch b/ansible-2.9.22-rocky.patch deleted file mode 100644 index 5f6c967e6e61007a27180ac6183c62b2bcf9b73a..0000000000000000000000000000000000000000 --- a/ansible-2.9.22-rocky.patch +++ /dev/null @@ -1,76 +0,0 @@ -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" -+} diff --git a/ansible-2.9.23-sphinx4.patch b/ansible-2.9.23-sphinx4.patch deleted file mode 100644 index de1d36805cd4ec4350a561b81df64a0c590e7658..0000000000000000000000000000000000000000 --- a/ansible-2.9.23-sphinx4.patch +++ /dev/null @@ -1,12 +0,0 @@ -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: diff --git a/ansible-2.9.24.tar.gz b/ansible-2.9.27.tar.gz similarity index 61% rename from ansible-2.9.24.tar.gz rename to ansible-2.9.27.tar.gz index 51b70b394126f28b3ed658fac6644980921a3b88..5a36ae02626dc7b1c02844547c90c86ff2bf90b6 100644 Binary files a/ansible-2.9.24.tar.gz and b/ansible-2.9.27.tar.gz differ diff --git a/ansible-2.9.6-disable-test_build_requirement_from_path_no_version.patch b/ansible-2.9.6-disable-test_build_requirement_from_path_no_version.patch deleted file mode 100644 index 9cbed834a5ec4606b8e3648de1159a83af8220f8..0000000000000000000000000000000000000000 --- a/ansible-2.9.6-disable-test_build_requirement_from_path_no_version.patch +++ /dev/null @@ -1,78 +0,0 @@ -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): diff --git a/ansible-generator b/ansible-generator deleted file mode 100644 index b7450b15df81fe1596e9491148817811debe745e..0000000000000000000000000000000000000000 --- a/ansible-generator +++ /dev/null @@ -1,46 +0,0 @@ -#!/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() diff --git a/ansible.attr b/ansible.attr deleted file mode 100644 index 997dafa4a31792d26aad888668ceb581843dac77..0000000000000000000000000000000000000000 --- a/ansible.attr +++ /dev/null @@ -1,3 +0,0 @@ -%__ansible_provides %{_rpmconfigdir}/ansible-generator --provides -%__ansible_requires %{_rpmconfigdir}/ansible-generator --requires -%__ansible_path ^%{_datadir}/ansible/collections/ansible_collections/[^/]+/[^/]+/MANIFEST.json$ diff --git a/ansible.spec b/ansible.spec index f4aaa3b9d820afa35d3346f53394ddebcfa3a946..45d0d5803ffc1b07fd94a1e4f035edeb86725ef6 100644 --- a/ansible.spec +++ b/ansible.spec @@ -1,228 +1,134 @@ -%global with_docs 1 -Name: ansible -Summary: SSH-based configuration management, deployment, and task execution system -Version: 2.9.24 -Release: 4 - -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 - -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 +%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. + +Name: ansible +Summary: SSH-based configuration management, deployment, and task execution system +Version: 2.9.27 +Release: 1 +License: Python-2.0 and MIT and GPL+ +Url: http://ansible.com +Source0: https://releases.ansible.com/ansible/%{name}-%{version}.tar.gz +Patch0: hostname-module-support-openEuler.patch +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-cryptography python3-paramiko +Requires: python3-setuptools python3-six sshpass python3-httplib2 +Requires: python3-jmespath python3-jinja2 +Recommends: %{name}-help = %{version}-%{release} +%description +%{common_desc} + +%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-cryptography python3-packaging +BuildRequires: python3-pexpect python3-winrm +BuildRequires: git-core +%if %with_docs +BuildRequires: python3-sphinx python3-sphinx-theme-alabaster asciidoc %endif -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 - +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 %description -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. - -%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} +%{common_desc} -%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. +%endif +%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 -%autosetup -p1 -cp -a %{S:1} %{S:2} %{S:3} . +%setup -q +%patch0 -p1 +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif %build -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//') +%if 0%{?with_python3} +pushd %{py3dir} %py3_build - -%if 0%{?with_docs} +%if %with_docs + pathfix.py -i %{__python3} -p docs/bin test/runner 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 -%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" +%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 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 0%{?with_docs} +%if %with_docs + pushd %{py3dir} 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 -%license COPYING -%doc README.rst PKG-INFO changelogs/CHANGELOG-v2.9.rst -%doc %{_mandir}/man1/ansible* -%config(noreplace) %{_sysconfdir}/ansible/ +%defattr(-,root,root) %{_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-doc +%config(noreplace) %{_sysconfdir}/ansible/ +%doc %{_mandir}/man1/ansible* +%if 0%{?with_python3} +%{python3_sitelib}/ansible* +%endif + +%files -n ansible-help %doc rst -%if 0%{?with_docs} +%if %with_docs %doc html %endif -%files -n ansible-test -%{_bindir}/ansible-test -%{python3_sitelib}/ansible_test - %changelog +* Tue Apr 14 2022 yangping - 2.9.27-1 +- Package update + * Thu Oct 28 2021 liwu - 2.9.24-4 +- The upstream community rolls back patch + +* Thu Oct 28 2021 liwu - 2.9.24-3 - The upstream community rolls back the patch - -* Fri Sep 17 2021 liwu - 2.9.24-3 -- fix CVE-2020-1738 -* Thu Sep 16 2021 liwu - 2.9.24-2 -- fix CVE-2020-1736 +* Sat Sep 18 2021 houyingchao - 2.9.24-2 +- Fix CVE-2020-1736 CVE-2020-1738 -* Tue Aug 17 2021 wulei - 2.9.24-1 +* Fri Sep 17 2021 houyingchao - 2.9.24-1 - update to 2.9.24 * Mon Jul 12 2021 liksh - 2.9.0-1 @@ -230,3 +136,4 @@ make PYTHON=/usr/bin/python3 tests-py3 * Tue Jan 12 2021 yanan li - 2.5.5-1 - Package init + diff --git a/fix-python-3.9-compatibility.patch b/fix-python-3.9-compatibility.patch deleted file mode 100644 index 0cc6fee99f0eef852e5ae651860cccd88974f964..0000000000000000000000000000000000000000 --- a/fix-python-3.9-compatibility.patch +++ /dev/null @@ -1,43 +0,0 @@ -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', - ) - - diff --git a/hostname-module-support-openEuler.patch b/hostname-module-support-openEuler.patch new file mode 100644 index 0000000000000000000000000000000000000000..9c17f95a667c10062d6d1e4d90372428c9afa593 --- /dev/null +++ b/hostname-module-support-openEuler.patch @@ -0,0 +1,40 @@ +From ae7a72600932ba4a1c1a3c85115f9b609afb7bd5 Mon Sep 17 00:00:00 2001 +Date: Mon, 28 Feb 2022 20:02:47 +0800 +Subject: [PATCH 1/1] hostname module support openEuler + +--- + lib/ansible/module_utils/facts/system/distribution.py | 2 +- + lib/ansible/modules/system/hostname.py | 4 ++++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/lib/ansible/module_utils/facts/system/distribution.py b/lib/ansible/module_utils/facts/system/distribution.py +index 09b5a5fd..9046a34a 100644 +--- a/lib/ansible/module_utils/facts/system/distribution.py ++++ b/lib/ansible/module_utils/facts/system/distribution.py +@@ -467,7 +467,7 @@ class Distribution(object): + OS_FAMILY_MAP = {'RedHat': ['RedHat', 'Fedora', 'CentOS', 'Scientific', 'SLC', + 'Ascendos', 'CloudLinux', 'PSBM', 'OracleLinux', 'OVS', + 'OEL', 'Amazon', 'Virtuozzo', 'XenServer', 'Alibaba', +- 'AlmaLinux'], ++ 'AlmaLinux', 'openEuler'], + 'Debian': ['Debian', 'Ubuntu', 'Raspbian', 'Neon', 'KDE neon', + 'Linux Mint', 'SteamOS', 'Devuan', 'Kali', 'Cumulus Linux'], + 'Suse': ['SuSE', 'SLES', 'SLED', 'openSUSE', 'openSUSE Tumbleweed', +diff --git a/lib/ansible/modules/system/hostname.py b/lib/ansible/modules/system/hostname.py +index bfc24b35..f10739c5 100644 +--- a/lib/ansible/modules/system/hostname.py ++++ b/lib/ansible/modules/system/hostname.py +@@ -782,6 +782,10 @@ class NeonHostname(Hostname): + distribution = 'Neon' + strategy_class = DebianStrategy + ++class OpenEulerHostname(Hostname): ++ platform = 'Linux' ++ distribution = 'Openeuler' ++ strategy_class = SystemdStrategy + + def main(): + module = AnsibleModule( +-- +2.27.0 + diff --git a/macros.ansible b/macros.ansible deleted file mode 100644 index c8c91fb7640f76758d90656f2b00ac12d97dc2d2..0000000000000000000000000000000000000000 --- a/macros.ansible +++ /dev/null @@ -1,7 +0,0 @@ -%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}/