diff --git a/0001-Fix-final-fact-delegation-77008-77017.patch b/0001-Fix-final-fact-delegation-77008-77017.patch deleted file mode 100644 index 0d8e9943bb8414d7febdcc33e48671ca09e38e1c..0000000000000000000000000000000000000000 --- a/0001-Fix-final-fact-delegation-77008-77017.patch +++ /dev/null @@ -1,87 +0,0 @@ -From ae35fc04c3a2068b1d37efe813d1c6938b4f2634 Mon Sep 17 00:00:00 2001 -From: Brian Coca -Date: Wed, 16 Feb 2022 11:55:03 -0500 -Subject: [PATCH] Fix final fact delegation (#77008) (#77017) - -* fix facts delegation loop overwrite - - partial revert of change to allow facts to be present in each loop iteration - was not needed in final results as result processing alreayd had the disctiontion - and ended up breaking the assumptions in the calling code. - - fixes #76676 - -(cherry picked from commit c9d3518d2f3812787e1627806b5fa93f8fae48a6) ---- - .../fragments/fix_fax_delegation_loops.yml | 2 ++ - lib/ansible/executor/task_executor.py | 8 +------ - .../delegate_to/delegate_facts_loop.yml | 21 ++++++++++++++++++- - 3 files changed, 23 insertions(+), 8 deletions(-) - create mode 100644 changelogs/fragments/fix_fax_delegation_loops.yml - -diff --git a/changelogs/fragments/fix_fax_delegation_loops.yml b/changelogs/fragments/fix_fax_delegation_loops.yml -new file mode 100644 -index 0000000000..d9e07bf110 ---- /dev/null -+++ b/changelogs/fragments/fix_fax_delegation_loops.yml -@@ -0,0 +1,2 @@ -+bugfixes: -+ - task_executor reverts the change to push facts into delegated vars on loop finalization as result managing code already handles this and was duplicating effort to wrong result. -diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py -index 1a7c666fea..05dcb96446 100644 ---- a/lib/ansible/executor/task_executor.py -+++ b/lib/ansible/executor/task_executor.py -@@ -745,13 +745,7 @@ class TaskExecutor: - - if 'ansible_facts' in result and self._task.action not in C._ACTION_DEBUG: - if self._task.action in C._ACTION_WITH_CLEAN_FACTS: -- if self._task.delegate_to and self._task.delegate_facts: -- if '_ansible_delegated_vars' in variables: -- variables['_ansible_delegated_vars'].update(result['ansible_facts']) -- else: -- variables['_ansible_delegated_vars'] = result['ansible_facts'] -- else: -- variables.update(result['ansible_facts']) -+ variables.update(result['ansible_facts']) - else: - # TODO: cleaning of facts should eventually become part of taskresults instead of vars - af = wrap_var(result['ansible_facts']) -diff --git a/test/integration/targets/delegate_to/delegate_facts_loop.yml b/test/integration/targets/delegate_to/delegate_facts_loop.yml -index 90a25676dd..28a1488de3 100644 ---- a/test/integration/targets/delegate_to/delegate_facts_loop.yml -+++ b/test/integration/targets/delegate_to/delegate_facts_loop.yml -@@ -5,7 +5,6 @@ - test: 123 - delegate_to: "{{ item }}" - delegate_facts: true -- when: test is not defined - loop: "{{ groups['all'] | difference(['localhost']) }}" - - - name: ensure we didnt create it on current host -@@ -19,3 +18,23 @@ - - "'test' in hostvars[item]" - - hostvars[item]['test'] == 123 - loop: "{{ groups['all'] | difference(['localhost']) }}" -+ -+ -+- name: test that we don't polute whole group with one value -+ hosts: localhost -+ gather_facts: no -+ vars: -+ cluster_name: bleh -+ tasks: -+ - name: construct different fact per host in loop -+ set_fact: -+ vm_name: "{{ cluster_name }}-{{item}}" -+ delegate_to: "{{ item }}" -+ delegate_facts: True -+ with_items: "{{ groups['all'] }}" -+ -+ - name: ensure the fact is personalized for each host -+ assert: -+ that: -+ - hostvars[item]['vm_name'].endswith(item) -+ loop: "{{ groups['all'] }}" --- -2.30.2 - diff --git a/ansible-core.spec b/ansible-core.spec index 71c6c839953e6416258af077b2d00ffdbc2f57d5..ac3d4a05fba070c9bc6407a005486a7191fdddea 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -1,4 +1,3 @@ -%define anolis_release .0.1 # We need this because we are no longer noarch, since our bundled deps might # conceivably need to compile arch-specific things. But we currently have no # useful debuginfo stuff. @@ -8,12 +7,11 @@ # ansible-test munges the shebangs itself. %global __brp_mangle_shebangs_exclude_from_file %{SOURCE1} -%global commitId 6c75cf5c83da044d1fd69bc444ce4de50d728d09 -%global python38_sitelib /usr/lib/python3.8/site-packages/ +# Filter requires on jinja2 since bundled +%global __requires_exclude jinja2 -# NOTE(pabelanger): Don't auto add pwsh as Requires for ansible-test. We do -# not wish to package it. -%global __requires_exclude ^/usr/bin/pwsh$ +%global commitId 520bb66f8ab6d53750f48f024287572962d975fa +%global python39_sitelib /usr/lib/python3.9/site-packages/ # RHEL and Fedora add -s to the shebang line. We do *not* use -s -E -S or -I # with ansible because it has many optional features which users need to @@ -24,10 +22,12 @@ %define py2_shbang_opts %{nil} %define py3_shbang_opts %{nil} -%define vendor_path %{buildroot}%{python38_sitelib}/ansible/_vendor/ -%define vendor_pip /usr/bin/python3.8 -m pip install --no-deps -v --no-use-pep517 --no-binary :all: -t %{vendor_path} +%define vendor_path %{buildroot}%{python39_sitelib}/ansible/_vendor/ +%define vendor_pip /usr/bin/python3.9 -m pip install --no-deps -v --no-use-pep517 --no-binary :all: -t %{vendor_path} # These control which bundled dep versions we pin against +%global jinja2_version 3.1.2 +%global markupsafe_version 2.1.0 %global packaging_version 20.4 %global pyparsing_version 2.4.7 %global straightplugin_version 1.4.1 @@ -35,9 +35,8 @@ Name: ansible-core Summary: SSH-based configuration management, deployment, and task execution system -Version: 2.12.2 -Release: 4%{anolis_release}%{?dist} -ExcludeArch: i686 +Version: 2.14.0 +Release: 1%{?dist} Group: Development/Libraries License: GPLv3+ @@ -45,19 +44,19 @@ Source0: ansible-%{commitId}.tar.gz Source1: ansible-test-data-files.txt # And bundled deps -Source2: packaging-ded06cedf6e20680eea0363fac894cb4a09e7831.tar.gz -Source3: pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605.tar.gz +Source2: jinja2-b08cd4bc64bb980df86ed2876978ae5735572280.tar.gz +Source3: markupsafe-b5a517506d6cb8091e215a4a89e47db5eee6a68f.tar.gz +Source4: packaging-ded06cedf6e20680eea0363fac894cb4a09e7831.tar.gz +Source5: pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605.tar.gz # Deps to build man pages -Source5: straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed.tar.gz - -Patch0: 0001-Fix-final-fact-delegation-77008-77017.patch +Source6: straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed.tar.gz URL: http://ansible.com -# We conflict old ansible, and any version of ansible-base. -Conflicts: ansible < 2.10.0 -Conflicts: ansible-base +# We obsolete old ansible, and any version of ansible-base. +Obsoletes: ansible < 2.10.0 +Obsoletes: ansible-base # ... and provide 'ansible' so that old packages still work without updated # spec files. @@ -65,34 +64,33 @@ Conflicts: ansible-base # Bundled provides that are sprinkled throughout the codebase. Provides: bundled(python-backports-ssl_match_hostname) = 3.7.0.1 -Provides: bundled(python-distro) = 1.5.0 +Provides: bundled(python-distro) = 1.6.0 Provides: bundled(python-selectors2) = 1.1.1 -Provides: bundled(python-six) = 1.13.0 +Provides: bundled(python-six) = 1.16.0 # Things we explicitly bundle via src rpm, and put in ansible._vendor +Provides: bundled(python-jinja2) = %{jinja2_version} +Provides: bundled(python-markupsafe) = %{markupsafe_version} Provides: bundled(python-packaging) = %{packaging_version} Provides: bundled(python-pyparsing) = %{pyparsing_version} Provides: bundled(python-straightplugin) = %{straightplugin_version} -Provides: /usr/bin/ansible - -BuildRequires: python38-devel -# BuildRequires: python38-docutils -BuildRequires: python38-jinja2 -BuildRequires: python38-pip -BuildRequires: python38-pyyaml -BuildRequires: python38-resolvelib -BuildRequires: python38-rpm-macros -BuildRequires: python38-setuptools -BuildRequires: python38-wheel - -Requires: git -Requires: python38 -Requires: python38-jinja2 -Requires: python38-PyYAML -Requires: python38-cryptography -Requires: python38-resolvelib -Requires: python38-six +BuildRequires: python3-devel +BuildRequires: python3-docutils +BuildRequires: python3-pip +BuildRequires: python3-pyyaml +BuildRequires: python3-resolvelib +BuildRequires: python3-rpm-macros +BuildRequires: python3-setuptools +BuildRequires: python3-wheel +BuildRequires: make git-core gcc + +Requires: git-core +Requires: python3 +Requires: python3-PyYAML >= 5.1 +Requires: python3-cryptography +Requires: python3-resolvelib >= 0.5.3 +Requires: python3-six Requires: sshpass %description @@ -116,37 +114,26 @@ are transferred to managed machines automatically. This package installs the ansible-test command for testing modules and plugins developed for ansible. -%package doc -Summary: Documents for %{name} -BuildArch: noarch -Requires: %{name} = %{version}-%{release} - -%description doc -Doc pages for %{name}. - %prep -%setup -q -T -b 2 -n packaging-ded06cedf6e20680eea0363fac894cb4a09e7831 -%setup -q -T -b 3 -n pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605 -%setup -q -T -b 5 -n straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed +%setup -q -T -b 2 -n jinja2-b08cd4bc64bb980df86ed2876978ae5735572280 +%setup -q -T -b 3 -n markupsafe-b5a517506d6cb8091e215a4a89e47db5eee6a68f +%setup -q -T -b 4 -n packaging-ded06cedf6e20680eea0363fac894cb4a09e7831 +%setup -q -T -b 5 -n pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605 +%setup -q -T -b 6 -n straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed %setup -q -n ansible-%{commitId} -%patch0 -p 1 - -# Fix all Python shebangs recursively in ansible-test -# -p preserves timestamps -# -n prevents creating ~backup files -# -i specifies the interpreter for the shebang -pathfix3.8.py -pni "%{__python3} %{py3_shbang_opts}" test/lib/ansible_test %build -/usr/bin/python3.8 setup.py build +/usr/bin/python3.9 setup.py build %install -/usr/bin/python3.8 setup.py install --root %{buildroot} +/usr/bin/python3.9 setup.py install --root %{buildroot} # Handle bundled deps: %{vendor_pip} \ - ../pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605/ \ - ../packaging-ded06cedf6e20680eea0363fac894cb4a09e7831/ + ../jinja2-b08cd4bc64bb980df86ed2876978ae5735572280/ \ + ../markupsafe-b5a517506d6cb8091e215a4a89e47db5eee6a68f/ \ + ../packaging-ded06cedf6e20680eea0363fac894cb4a09e7831/ \ + ../pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605/ # Create system directories that Ansible defines as default locations in # ansible/config/base.yml @@ -188,18 +175,18 @@ mkdir -p %{buildroot}%{_sysconfdir}/ansible/roles/ cp examples/hosts %{buildroot}%{_sysconfdir}/ansible/ cp examples/ansible.cfg %{buildroot}%{_sysconfdir}/ansible/ mkdir -p %{buildroot}/%{_mandir}/man1/ -## Build man pages -# -#mkdir /tmp/_vendor -#/usr/bin/python3.8 -m pip install ../straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed -t /tmp/_vendor --no-build-isolation -# -## Remove plugins not needed, they bring in more dependencies -#find hacking/build_library/build_ansible/command_plugins ! -name 'generate_man.py' -type f -exec rm -f {} + -# -#PYTHON=python3.8 PYTHONPATH=%{vendor_path}:/tmp/_vendor make docs -#cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/ -# -#cp -pr docs/docsite/rst . +# Build man pages + +mkdir /tmp/_vendor +/usr/bin/python3.9 -m pip install ../straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed -t /tmp/_vendor --no-build-isolation + +# Remove plugins not needed, they bring in more dependencies +find hacking/build_library/build_ansible/command_plugins ! -name 'generate_man.py' -type f -exec rm -f {} + + +PYTHON=python3.9 PYTHONPATH=%{vendor_path}:/tmp/_vendor make docs +cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/ + +cp -pr docs/docsite/rst . cp -p lib/ansible_core.egg-info/PKG-INFO . %files @@ -207,46 +194,86 @@ cp -p lib/ansible_core.egg-info/PKG-INFO . %{_bindir}/ansible* %exclude %{_bindir}/ansible-test %config(noreplace) %{_sysconfdir}/ansible/ -# TODO(pabelanger): uncomment once we move back to tagged releases -# %doc changelogs/CHANGELOG-v2.*.rst -#%doc %{_mandir}/man1/ansible* +%doc README.rst PKG-INFO COPYING +%doc changelogs/CHANGELOG-v2.*.rst +%doc %{_mandir}/man1/ansible* %{_datadir}/ansible/ -%{python38_sitelib}/ansible* -%exclude %{python38_sitelib}/ansible_test +%{python39_sitelib}/ansible* +%exclude %{python39_sitelib}/ansible_test +%exclude %{python39_sitelib}/ansible/_vendor/markupsafe/_speedups.c %files -n ansible-test %{_bindir}/ansible-test -%{python38_sitelib}/ansible_test - -%files doc -%doc README.rst PKG-INFO COPYING +%{python39_sitelib}/ansible_test %changelog -* Fri Sep 23 2022 Bo Ren - 2.12.2-4.0.1 -- Add doc sub package +* Tue Nov 08 2022 Dimitri Savineau - 2.14.0-1 +- ansible-core 2.14.0 release (rhbz#2141116) -* Tue Jul 19 2022 Dimitri Savineau - 2.12.2-4 -- fix facts delegation loop overwrite (rhbz#2109263) +* Mon Nov 07 2022 Dimitri Savineau - 2.13.6-1 +- ansible-core 2.13.6 release (rhbz#2140778) +- fix service_facts module parsing (rhbz#2128801) -* Thu Mar 10 2022 Dimitri Savineau - 2.12.2-3.1 -- Rebuilt for rhel-8.6 +* Tue Oct 11 2022 James Marshall - 2.13.5-1 +- ansible-core 2.13.5 release (rhbz#2133912) -* Mon Mar 07 2022 Dimitri Savineau - 2.12.2-3 -- replace Obsolete to Conflicts +* Thu Oct 06 2022 Dimitri Savineau - 2.13.4-1 +- ansible-core 2.13.4 release (rhbz#2132807) -* Wed Feb 02 2022 Dimitri Savineau - 2.12.2-2 -- fix ansible tarball setup +* Mon Aug 15 2022 James Marshall - 2.13.3-1 +- ansible-core 2.13.3 release (rhbz#2118458) -* Wed Feb 02 2022 Dimitri Savineau - 2.12.2-1 -- ansible-core 2.12.2 release -- add gating and test files +* Mon Jul 18 2022 James Marshall - 2.13.2-1 +- ansible-core 2.13.2 release (rhbz#2108229) + +* Mon Jun 27 2022 Dimitri Savineau - 2.13.1-2 +- Update bundled jinja2 version to 3.1.2 (rhbz#2101462) -* Wed Jan 19 2022 Dimitri Savineau - 2.12.1-2 -- Remove Provides on ansible +* Wed Jun 22 2022 Dimitri Savineau - 2.13.1-1 +- ansible-core 2.13.1 release (rhbz#2100242) +- add bundled version of jinja2 and markupsafe -* Thu Dec 16 2021 Yanis Guenane - 2.12.1-1 +* Mon Jun 20 2022 Dimitri Savineau - 2.12.7-1 +- ansible-core 2.12.7 release (rhbz#2099317) +- remove legacy nightly configuration + +* Tue May 24 2022 James Marshall - 2.12.6-1 +- ansible-core 2.12.6 release + +* Fri May 13 2022 Dimitri Savineau - 2.12.5-2 +- switch from git to git-core dependency (rhbz#2083386) + +* Mon May 09 2022 Dimitri Savineau - 2.12.5-1 +- ansible-core 2.12.5 release + +* Wed Apr 06 2022 James Marshall - 2.12.4-1 +- ansible-core 2.12.4 release + +* Mon Mar 14 2022 Dimitri Savineau - 2.12.3-1 +- ansible-core 2.12.3 release + +* Tue Feb 01 2022 Dimitri Savineau - 2.12.2-1 +- ansible-core 2.12.2 release + +* Tue Dec 07 2021 James Marshall - 2.12.1-1 - ansible-core 2.12.1-1 +* Mon Nov 08 2021 Dimitri Savineau - 2.12.0-1 +- ansible-core 2.12.0-1 + +* Tue Oct 12 2021 Christian Adams - 2.11.6-1 +- ansible-core 2.11.6-1, fix CVE-2021-3620, ansible-connection module + no long discloses sensitive info. + +* Wed Oct 06 2021 Yanis Guenane - 2.11.5-3 +- ansible-core 2.11.5-3, add virtual provide for straightplugin + +* Wed Sep 15 2021 Josh Boyer - 2.11.5-2 +- ansible-core 2.11.5-2 + +* Mon Sep 13 2021 Josh Boyer - 2.11.3-3 +- Bump for build + * Wed Jul 21 2021 Paul Belanger - 2.11.3-2 - Add git dependency for ansible-galaxy CLI command. diff --git a/ansible-test-data-files.txt b/ansible-test-data-files.txt index 9a7f880ba35d40c5af66c6ebf0326faeb93da72b..3f785f2519461db6951c5d09aaebafe48960d0c3 100644 --- a/ansible-test-data-files.txt +++ b/ansible-test-data-files.txt @@ -1 +1,2 @@ /usr/lib/python[0-9]+\.[0-9]+/site-packages/ansible_test/_data/.* +/usr/lib/python[0-9]+\.[0-9]+/site-packages/ansible_test/_util/.* diff --git a/download b/download index 9ec5fbaa0d2a453dddae3e3738f156cc3cae59db..8324625c4a60304c2049676f899166356bef6b21 100644 --- a/download +++ b/download @@ -1,4 +1,6 @@ -47e3fc5bf02c3e25251f1c6cbdd76879 ansible-6c75cf5c83da044d1fd69bc444ce4de50d728d09.tar.gz +51f6abb8a6b01af2cbf90c558ad93cb6 ansible-520bb66f8ab6d53750f48f024287572962d975fa.tar.gz +c092cbdf8cc98593a45e81a43f6aa129 jinja2-b08cd4bc64bb980df86ed2876978ae5735572280.tar.gz +4cc998fcca4f0ce27525826299f522a7 markupsafe-b5a517506d6cb8091e215a4a89e47db5eee6a68f.tar.gz b807514ccc85b052e576860904387a37 packaging-ded06cedf6e20680eea0363fac894cb4a09e7831.tar.gz 6935fa01ae25d95f036094763499bc67 pyparsing-6a844ee35ca5125490a28dbd6dd2d15b6498e605.tar.gz c720f6d7f45c900348674a83d7eec605 straightplugin-6634ea8e1e89d5bb23804f50e676f196c52c46ed.tar.gz