From bc39f5ceeb66ba62cece55e08be287a883f957ab Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Sun, 30 Apr 2023 21:31:54 -0500 Subject: [PATCH 01/18] Update to 2.14.5. Fixes rhbz#2189287. --- .gitignore | 1 + ansible-core.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 95da300..d593353 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ /ansible-core-2.14.2.tar.gz /ansible-core-2.14.3.tar.gz /ansible-core-2.14.4.tar.gz +/ansible-core-2.14.5.tar.gz diff --git a/ansible-core.spec b/ansible-core.spec index 8f3f9f0..e094db2 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -4,7 +4,7 @@ Name: ansible-core Summary: A radically simple IT automation system -Version: 2.14.4 +Version: 2.14.5 %global uversion %{version_no_tilde %{quote:%nil}} Release: 1%{?dist} # The main license is GPLv3+. Many of the files in lib/ansible/module_utils @@ -240,6 +240,9 @@ make PYTHON=%{python3} tests-py3 %changelog +* Mon May 01 2023 Maxwell G - 2.14.5-1 +- Update to 2.14.5. Fixes rhbz#2189287. + * Wed Mar 29 2023 Maxwell G - 2.14.4-1 - Update to 2.14.4. Fixes rhbz#2173765. diff --git a/sources b/sources index d6a3fd6..2c29ff5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-core-2.14.4.tar.gz) = 060ade1c5ddba619211a0797977ef08ffd5c80f4bbae02b10a78ce37bdca6123368acee93ff33ace5d2f7c0d7a497e13e0ad1a6bd3235f9584fb75cf807baa96 +SHA512 (ansible-core-2.14.5.tar.gz) = 89fa298e7bc9f27390d8ac1228c7ca69913d7f2b1e01a636dfe60244e7fac2ea873ad170bb1dce09e9ed05f80e5ff4b66117a6aec24dbe95d2a0c852620c8c12 From 5efd27d138eca1e35564111592a97026f12ee644 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 20 Apr 2023 23:06:56 +0000 Subject: [PATCH 02/18] Add gating tests (cherry picked from commit 754b581240daac20f6c2a41a924e3eeaf85636b9) --- .fmf/version | 1 + gating.yaml | 10 ++++++++++ tests/smoke.sh | 17 +++++++++++++++++ tests/smoke1.fmf | 13 +++++++++++++ tests/smoke2.fmf | 13 +++++++++++++ 5 files changed, 54 insertions(+) create mode 100644 .fmf/version create mode 100644 gating.yaml create mode 100755 tests/smoke.sh create mode 100644 tests/smoke1.fmf create mode 100644 tests/smoke2.fmf diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..5480e33 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,10 @@ +--- !Policy +product_versions: + - fedora-* +decision_contexts: + - bodhi_update_push_testing + - bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} +... diff --git a/tests/smoke.sh b/tests/smoke.sh new file mode 100755 index 0000000..2ee036c --- /dev/null +++ b/tests/smoke.sh @@ -0,0 +1,17 @@ +#!/usr/bin/bash -x + +set -euo pipefail + +ansible --version +ansible -c local -i localhost, localhost -m setup +ansible -c local -i locahost, localhost -b \ + -m community.general.copr \ + -a "name=gotmax23/community.general.copr_integration_tests chroot=fedora-rawhide-x86_64" \ + |& tee out +grep 'localhost | CHANGED' out +ansible -c local -i localhost, localhost -b \ + -m package \ + -a name=copr-module-integration-dummy-package \ + |& tee out +grep 'localhost | CHANGED' out +rpm -ql copr-module-integration-dummy-package diff --git a/tests/smoke1.fmf b/tests/smoke1.fmf new file mode 100644 index 0000000..6b95320 --- /dev/null +++ b/tests/smoke1.fmf @@ -0,0 +1,13 @@ +discover: + - name: Smoke tests (1) + how: shell + tests: + - name: Smoke tests with ansible + test: tests/smoke.sh + require: + - python3-dnf + - dnf-plugins-core + - ansible-core + - ansible +execute: + how: tmt diff --git a/tests/smoke2.fmf b/tests/smoke2.fmf new file mode 100644 index 0000000..6d0f71a --- /dev/null +++ b/tests/smoke2.fmf @@ -0,0 +1,13 @@ +discover: + - name: Smoke tests (2) + how: shell + tests: + - name: Smoke tests with community.general + test: tests/smoke.sh + require: + - python3-dnf + - dnf-plugins-core + - ansible-core + - ansible-collection-community-general +execute: + how: tmt From c47227ea5e5230b88999026c255c71abe9b65df4 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Mon, 24 Apr 2023 23:14:54 +0000 Subject: [PATCH 03/18] backport GALAXY_COLLECTIONS_PATH_WARNINGS patch This will be used in the Fedora ansible-packaging macros to silence useless warnings when installing collections into %{buildroot}. (cherry picked from commit 37924c8f63cd4087128aef7124facc3e79d1ad47) --- GALAXY_COLLECTIONS_PATH_WARNINGS.patch | 65 ++++++++++++++++++++++++++ ansible-core.spec | 1 + tests/collections_path_warnings.sh | 54 +++++++++++++++++++++ tests/fedora.fmf | 16 +++++++ 4 files changed, 136 insertions(+) create mode 100644 GALAXY_COLLECTIONS_PATH_WARNINGS.patch create mode 100755 tests/collections_path_warnings.sh create mode 100644 tests/fedora.fmf diff --git a/GALAXY_COLLECTIONS_PATH_WARNINGS.patch b/GALAXY_COLLECTIONS_PATH_WARNINGS.patch new file mode 100644 index 0000000..59f8359 --- /dev/null +++ b/GALAXY_COLLECTIONS_PATH_WARNINGS.patch @@ -0,0 +1,65 @@ +From 734f38b2594692707d1fd3cbcfc8dc8a677f4ee3 Mon Sep 17 00:00:00 2001 +From: Maxwell G +Date: Fri, 21 Apr 2023 07:29:10 -0500 +Subject: [PATCH] Add GALAXY_COLLECTIONS_PATH_WARNINGS option. (#78487) + +* Add GALAXY_COLLECTIONS_PATH_WARNING option. + +This allows users to disable warnings from `ansible-galaxy collection +install` about `--collections-path` missing from Ansible's configured +collections_paths. +--- + .../fragments/78487-galaxy-collections-path-warnings.yml | 6 ++++++ + lib/ansible/cli/galaxy.py | 5 ++++- + lib/ansible/config/base.yml | 9 +++++++++ + 3 files changed, 19 insertions(+), 1 deletion(-) + create mode 100644 changelogs/fragments/78487-galaxy-collections-path-warnings.yml + +diff --git a/changelogs/fragments/78487-galaxy-collections-path-warnings.yml b/changelogs/fragments/78487-galaxy-collections-path-warnings.yml +new file mode 100644 +index 00000000000000..4702e94f961d82 +--- /dev/null ++++ b/changelogs/fragments/78487-galaxy-collections-path-warnings.yml +@@ -0,0 +1,6 @@ ++--- ++minor_changes: ++- >- ++ Add ``GALAXY_COLLECTIONS_PATH_WARNING`` option to disable the warning ++ given by ``ansible-galaxy collection install`` when installing a collection ++ to a path that isn't in the configured collection paths. +diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py +index fc88137ff63604..0deb0331a582b9 100755 +--- a/lib/ansible/cli/galaxy.py ++++ b/lib/ansible/cli/galaxy.py +@@ -1393,7 +1393,10 @@ def _execute_install_collection( + upgrade = context.CLIARGS.get('upgrade', False) + + collections_path = C.COLLECTIONS_PATHS +- if len([p for p in collections_path if p.startswith(path)]) == 0: ++ if ( ++ C.GALAXY_COLLECTIONS_PATH_WARNING ++ and len([p for p in collections_path if p.startswith(path)]) == 0 ++ ): + display.warning("The specified collections path '%s' is not part of the configured Ansible " + "collections paths '%s'. The installed collection will not be picked up in an Ansible " + "run, unless within a playbook-adjacent collections directory." % (to_text(path), to_text(":".join(collections_path)))) +diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml +index 052a8f0834e4ca..206deb76d2e916 100644 +--- a/lib/ansible/config/base.yml ++++ b/lib/ansible/config/base.yml +@@ -1366,6 +1366,15 @@ GALAXY_COLLECTION_SKELETON_IGNORE: + ini: + - {key: collection_skeleton_ignore, section: galaxy} + type: list ++GALAXY_COLLECTIONS_PATH_WARNING: ++ name: "ansible-galaxy collection install colections path warnings" ++ description: "whether ``ansible-galaxy collection install`` should warn about ``--collections-path`` missing from configured :ref:`collections_paths`" ++ default: true ++ type: bool ++ env: [{name: ANSIBLE_GALAXY_COLLECTIONS_PATH_WARNING}] ++ ini: ++ - {key: collections_path_warning, section: galaxy} ++ version_added: "2.16" + # TODO: unused? + #GALAXY_SCMS: + # name: Galaxy SCMS diff --git a/ansible-core.spec b/ansible-core.spec index e094db2..b37d52d 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -12,6 +12,7 @@ Release: 1%{?dist} # containing code under different licenses. License: GPL-3.0-or-later AND BSD-2-Clause AND PSF-2.0 AND MIT AND Apache-2.0 Source: https://github.com/ansible/ansible/archive/v%{uversion}/%{name}-%{uversion}.tar.gz +Patch: https://github.com/ansible/ansible/commit/734f38b2594692707d1fd3cbcfc8dc8a677f4ee3.patch#/GALAXY_COLLECTIONS_PATH_WARNINGS.patch Url: https://ansible.com BuildArch: noarch diff --git a/tests/collections_path_warnings.sh b/tests/collections_path_warnings.sh new file mode 100755 index 0000000..c4409e1 --- /dev/null +++ b/tests/collections_path_warnings.sh @@ -0,0 +1,54 @@ +#!/usr/bin/bash + +set -xeuo pipefail + +export NO_COLOR=1 + +TMP=$(mktemp -d) + +trap "rm -rf $TMP" EXIT + +testcase() { + set +x + echo + echo + echo "$1" + echo + echo + set -x +} + +fix_log() { + tr '\n' ' ' Date: Mon, 24 Apr 2023 23:26:23 +0000 Subject: [PATCH 04/18] tests: reorganize fmf plans (cherry picked from commit 27e02a89ac3607fd0f531efc2e2b77ce0c1e1191) --- tests/smoke1.fmf | 5 +++-- tests/smoke2.fmf | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/smoke1.fmf b/tests/smoke1.fmf index 6b95320..a586316 100644 --- a/tests/smoke1.fmf +++ b/tests/smoke1.fmf @@ -1,8 +1,9 @@ +summary: Run smoke tests with the ansible bundle installed discover: - - name: Smoke tests (1) + - name: Smoke tests with ansible how: shell tests: - - name: Smoke tests with ansible + - name: Run tests/smoke.sh test: tests/smoke.sh require: - python3-dnf diff --git a/tests/smoke2.fmf b/tests/smoke2.fmf index 6d0f71a..250065c 100644 --- a/tests/smoke2.fmf +++ b/tests/smoke2.fmf @@ -1,8 +1,9 @@ +summary: Run smoke tests with the standalone ansible-collection-community-general installed discover: - - name: Smoke tests (2) + - name: Smoke tests with community.general how: shell tests: - - name: Smoke tests with community.general + - name: Run tests/smoke.sh test: tests/smoke.sh require: - python3-dnf From fcbd0d4f322752dbf5259adbcb8e7d57c1e12509 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Mon, 29 May 2023 20:20:10 -0500 Subject: [PATCH 05/18] Update to 2.14.6. --- .gitignore | 1 + ansible-core.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d593353..d7faaa9 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ /ansible-core-2.14.3.tar.gz /ansible-core-2.14.4.tar.gz /ansible-core-2.14.5.tar.gz +/ansible-core-2.14.6.tar.gz diff --git a/ansible-core.spec b/ansible-core.spec index b37d52d..5c04bb2 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -4,7 +4,7 @@ Name: ansible-core Summary: A radically simple IT automation system -Version: 2.14.5 +Version: 2.14.6 %global uversion %{version_no_tilde %{quote:%nil}} Release: 1%{?dist} # The main license is GPLv3+. Many of the files in lib/ansible/module_utils @@ -241,6 +241,9 @@ make PYTHON=%{python3} tests-py3 %changelog +* Mon May 29 2023 Maxwell G - 2.14.6-1 +- Update to 2.14.6. + * Mon May 01 2023 Maxwell G - 2.14.5-1 - Update to 2.14.5. Fixes rhbz#2189287. diff --git a/sources b/sources index 2c29ff5..85e731e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-core-2.14.5.tar.gz) = 89fa298e7bc9f27390d8ac1228c7ca69913d7f2b1e01a636dfe60244e7fac2ea873ad170bb1dce09e9ed05f80e5ff4b66117a6aec24dbe95d2a0c852620c8c12 +SHA512 (ansible-core-2.14.6.tar.gz) = 8e9702c803796bae67d1c341691a8a101bb04be176b6d3125bf16f3420d2f6c31c2d734fec6bea3b361abe8a791b2bbb196ff18ac5d430a21bf6ffd6c144f7dc From 880f1819312281f0b139081b9681a743e87f01a6 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Tue, 16 May 2023 19:55:24 +0000 Subject: [PATCH 06/18] don't remove dotfiles and empty files. (cherry picked from commit f8ac3d7efa8510e2b390eaef1e20bbcc80f48969) --- ansible-core.rpmlintrc | 1 + ansible-core.spec | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 ansible-core.rpmlintrc diff --git a/ansible-core.rpmlintrc b/ansible-core.rpmlintrc new file mode 100644 index 0000000..b0a3fa2 --- /dev/null +++ b/ansible-core.rpmlintrc @@ -0,0 +1 @@ +addFilter("E: zero-length") diff --git a/ansible-core.spec b/ansible-core.spec index 5c04bb2..d1f21be 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -94,7 +94,6 @@ This package installs extensive documentation for ansible-core %prep %autosetup -p1 -n ansible-%{uversion} -find \( -name '.git_keep' -o -name '.rstcheck.cfg' \) -delete # ansible-test is executed directly by the Makefile, so we need to fix the shebang. sed -i -s 's|/usr/bin/env python|%{python3}|' \ @@ -203,9 +202,6 @@ cp examples/ansible.cfg %{buildroot}/etc/ansible/ mkdir -p %{buildroot}/%{_mandir}/man1 cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/ -# These files are needed for the unit tests, so we don't remove them in %%prep -find %{buildroot}/%{python3_sitelib} -name .travis.yml -type f -delete - # We install licenses in this manner so we don't miss new licenses: # 1. Copy all files in licenses to %%{_pkglicensedir}. # 2. List the files explicitly in %%files. @@ -243,6 +239,7 @@ make PYTHON=%{python3} tests-py3 %changelog * Mon May 29 2023 Maxwell G - 2.14.6-1 - Update to 2.14.6. +- Don't remove dotfiles and empty files. ansible-core actually needs these. * Mon May 01 2023 Maxwell G - 2.14.5-1 - Update to 2.14.5. Fixes rhbz#2189287. From acd56c613e75b0e56a8fd3154f9663a02fe3f4b1 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 30 Jun 2023 15:20:42 -0500 Subject: [PATCH 07/18] Update to 2.14.7. --- .gitignore | 1 + ansible-core.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d7faaa9..df065cb 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ /ansible-core-2.14.4.tar.gz /ansible-core-2.14.5.tar.gz /ansible-core-2.14.6.tar.gz +/ansible-core-2.14.7.tar.gz diff --git a/ansible-core.spec b/ansible-core.spec index d1f21be..010bf72 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -4,7 +4,7 @@ Name: ansible-core Summary: A radically simple IT automation system -Version: 2.14.6 +Version: 2.14.7 %global uversion %{version_no_tilde %{quote:%nil}} Release: 1%{?dist} # The main license is GPLv3+. Many of the files in lib/ansible/module_utils @@ -237,6 +237,9 @@ make PYTHON=%{python3} tests-py3 %changelog +* Fri Jun 30 2023 Maxwell G - 2.14.7-1 +- Update to 2.14.7. + * Mon May 29 2023 Maxwell G - 2.14.6-1 - Update to 2.14.6. - Don't remove dotfiles and empty files. ansible-core actually needs these. diff --git a/sources b/sources index 85e731e..d145537 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-core-2.14.6.tar.gz) = 8e9702c803796bae67d1c341691a8a101bb04be176b6d3125bf16f3420d2f6c31c2d734fec6bea3b361abe8a791b2bbb196ff18ac5d430a21bf6ffd6c144f7dc +SHA512 (ansible-core-2.14.7.tar.gz) = 5051c5cdc2655e0db595efc93d53bde3ce552378a8007257647a2298c9b0422550fff70f737803eb57aed852915264fd88a96dd2ce0e30ce839003c396e261d5 From 765fff36cfcb866898d529b04df77fb384a58038 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 30 Jun 2023 20:44:59 +0000 Subject: [PATCH 08/18] Remove straight-plugin BuildRequires This requirement was removed in the last release. --- ansible-core.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/ansible-core.spec b/ansible-core.spec index 010bf72..1f0e4c5 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -49,7 +49,6 @@ Obsoletes: ansible-base < 2.10.6-1 BuildRequires: make BuildRequires: python%{python3_pkgversion}-devel # Needed to build manpages from source. -BuildRequires: python%{python3_pkgversion}-straight-plugin BuildRequires: python%{python3_pkgversion}-docutils # Shell completions BuildRequires: python%{python3_pkgversion}-argcomplete From 1d8e7353e5219607d10e5de40656330b9022d3e1 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Mon, 10 Jul 2023 16:14:05 +0000 Subject: [PATCH 09/18] Make url module_util compatible with Python 3.12 hosts --- ansible-core.spec | 11 +- urls-remove-deprecated-client-key-calls.patch | 154 ++++++++++++++++++ 2 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 urls-remove-deprecated-client-key-calls.patch diff --git a/ansible-core.spec b/ansible-core.spec index 1f0e4c5..5fb2913 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -6,13 +6,18 @@ Name: ansible-core Summary: A radically simple IT automation system Version: 2.14.7 %global uversion %{version_no_tilde %{quote:%nil}} -Release: 1%{?dist} +Release: 2%{?dist} # The main license is GPLv3+. Many of the files in lib/ansible/module_utils # are BSD licensed. There are various files scattered throughout the codebase # containing code under different licenses. License: GPL-3.0-or-later AND BSD-2-Clause AND PSF-2.0 AND MIT AND Apache-2.0 Source: https://github.com/ansible/ansible/archive/v%{uversion}/%{name}-%{uversion}.tar.gz Patch: https://github.com/ansible/ansible/commit/734f38b2594692707d1fd3cbcfc8dc8a677f4ee3.patch#/GALAXY_COLLECTIONS_PATH_WARNINGS.patch +# urls - remove deprecated client key calls (#80751) +# This is needed for Python 3.12, but we apply it unconditionally so +# controllers running on older Fedora versions can still work with Python 3.12 +# F39+ targets. +Patch: https://github.com/ansible/ansible/commit/0df794e5a4fe4597ee65b0d492fbf0d0989d5ca0.patch#/urls-remove-deprecated-client-key-calls.patch Url: https://ansible.com BuildArch: noarch @@ -236,6 +241,10 @@ make PYTHON=%{python3} tests-py3 %changelog +* Mon Jul 10 2023 Maxwell G - 2.14.7-2 +- Backport patch to make the `url` module_util compatible with Python 3.12 + (Fedora 39+) hosts + * Fri Jun 30 2023 Maxwell G - 2.14.7-1 - Update to 2.14.7. diff --git a/urls-remove-deprecated-client-key-calls.patch b/urls-remove-deprecated-client-key-calls.patch new file mode 100644 index 0000000..1e7d9cd --- /dev/null +++ b/urls-remove-deprecated-client-key-calls.patch @@ -0,0 +1,154 @@ +From 0df794e5a4fe4597ee65b0d492fbf0d0989d5ca0 Mon Sep 17 00:00:00 2001 +From: Jordan Borean +Date: Thu, 18 May 2023 08:17:25 +1000 +Subject: [PATCH] urls - remove deprecated client key calls (#80751) + +--- + .../fragments/urls-client-cert-py12.yml | 2 ++ + lib/ansible/module_utils/urls.py | 28 +++++++++++-------- + test/units/module_utils/urls/test_Request.py | 14 ++++------ + 3 files changed, 24 insertions(+), 20 deletions(-) + create mode 100644 changelogs/fragments/urls-client-cert-py12.yml + +diff --git a/changelogs/fragments/urls-client-cert-py12.yml b/changelogs/fragments/urls-client-cert-py12.yml +new file mode 100644 +index 00000000000000..aab129ed96e94b +--- /dev/null ++++ b/changelogs/fragments/urls-client-cert-py12.yml +@@ -0,0 +1,2 @@ ++bugfixes: ++- urls.py - fixed cert_file and key_file parameters when running on Python 3.12 - https://github.com/ansible/ansible/issues/80490 +diff --git a/lib/ansible/module_utils/urls.py b/lib/ansible/module_utils/urls.py +index 0e5fbb74c4fae2..0197d86e1033b2 100644 +--- a/lib/ansible/module_utils/urls.py ++++ b/lib/ansible/module_utils/urls.py +@@ -535,15 +535,18 @@ def __init__(self, message, import_traceback, module=None): + UnixHTTPSConnection = None + if hasattr(httplib, 'HTTPSConnection') and hasattr(urllib_request, 'HTTPSHandler'): + class CustomHTTPSConnection(httplib.HTTPSConnection): # type: ignore[no-redef] +- def __init__(self, *args, **kwargs): ++ def __init__(self, client_cert=None, client_key=None, *args, **kwargs): + httplib.HTTPSConnection.__init__(self, *args, **kwargs) + self.context = None + if HAS_SSLCONTEXT: + self.context = self._context + elif HAS_URLLIB3_PYOPENSSLCONTEXT: + self.context = self._context = PyOpenSSLContext(PROTOCOL) +- if self.context and self.cert_file: +- self.context.load_cert_chain(self.cert_file, self.key_file) ++ ++ self._client_cert = client_cert ++ self._client_key = client_key ++ if self.context and self._client_cert: ++ self.context.load_cert_chain(self._client_cert, self._client_key) + + def connect(self): + "Connect to a host on a given (SSL) port." +@@ -564,10 +567,10 @@ def connect(self): + if HAS_SSLCONTEXT or HAS_URLLIB3_PYOPENSSLCONTEXT: + self.sock = self.context.wrap_socket(sock, server_hostname=server_hostname) + elif HAS_URLLIB3_SSL_WRAP_SOCKET: +- self.sock = ssl_wrap_socket(sock, keyfile=self.key_file, cert_reqs=ssl.CERT_NONE, # pylint: disable=used-before-assignment +- certfile=self.cert_file, ssl_version=PROTOCOL, server_hostname=server_hostname) ++ self.sock = ssl_wrap_socket(sock, keyfile=self._client_key, cert_reqs=ssl.CERT_NONE, # pylint: disable=used-before-assignment ++ certfile=self._client_cert, ssl_version=PROTOCOL, server_hostname=server_hostname) + else: +- self.sock = ssl.wrap_socket(sock, keyfile=self.key_file, certfile=self.cert_file, ssl_version=PROTOCOL) ++ self.sock = ssl.wrap_socket(sock, keyfile=self._client_key, certfile=self._client_cert, ssl_version=PROTOCOL) + + class CustomHTTPSHandler(urllib_request.HTTPSHandler): # type: ignore[no-redef] + +@@ -602,10 +605,6 @@ def https_open(self, req): + return self.do_open(self._build_https_connection, req) + + def _build_https_connection(self, host, **kwargs): +- kwargs.update({ +- 'cert_file': self.client_cert, +- 'key_file': self.client_key, +- }) + try: + kwargs['context'] = self._context + except AttributeError: +@@ -613,7 +612,7 @@ def _build_https_connection(self, host, **kwargs): + if self._unix_socket: + return UnixHTTPSConnection(self._unix_socket)(host, **kwargs) + if not HAS_SSLCONTEXT: +- return CustomHTTPSConnection(host, **kwargs) ++ return CustomHTTPSConnection(host, client_cert=self.client_cert, client_key=self.client_key, **kwargs) + return httplib.HTTPSConnection(host, **kwargs) + + @contextmanager +@@ -979,7 +978,7 @@ def atexit_remove_file(filename): + pass + + +-def make_context(cafile=None, cadata=None, ciphers=None, validate_certs=True): ++def make_context(cafile=None, cadata=None, ciphers=None, validate_certs=True, client_cert=None, client_key=None): + if ciphers is None: + ciphers = [] + +@@ -1006,6 +1005,9 @@ def make_context(cafile=None, cadata=None, ciphers=None, validate_certs=True): + if ciphers: + context.set_ciphers(':'.join(map(to_native, ciphers))) + ++ if client_cert: ++ context.load_cert_chain(client_cert, keyfile=client_key) ++ + return context + + +@@ -1514,6 +1516,8 @@ def open(self, method, url, data=None, headers=None, use_proxy=None, + cadata=cadata, + ciphers=ciphers, + validate_certs=validate_certs, ++ client_cert=client_cert, ++ client_key=client_key, + ) + handlers.append(HTTPSClientAuthHandler(client_cert=client_cert, + client_key=client_key, +diff --git a/test/units/module_utils/urls/test_Request.py b/test/units/module_utils/urls/test_Request.py +index d2c4ea38012a49..a8bc3a0b6bde3b 100644 +--- a/test/units/module_utils/urls/test_Request.py ++++ b/test/units/module_utils/urls/test_Request.py +@@ -33,6 +33,7 @@ def install_opener_mock(mocker): + def test_Request_fallback(urlopen_mock, install_opener_mock, mocker): + here = os.path.dirname(__file__) + pem = os.path.join(here, 'fixtures/client.pem') ++ client_key = os.path.join(here, 'fixtures/client.key') + + cookies = cookiejar.CookieJar() + request = Request( +@@ -46,8 +47,8 @@ def test_Request_fallback(urlopen_mock, install_opener_mock, mocker): + http_agent='ansible-tests', + force_basic_auth=True, + follow_redirects='all', +- client_cert='/tmp/client.pem', +- client_key='/tmp/client.key', ++ client_cert=pem, ++ client_key=client_key, + cookies=cookies, + unix_socket='/foo/bar/baz.sock', + ca_path=pem, +@@ -68,8 +69,8 @@ def test_Request_fallback(urlopen_mock, install_opener_mock, mocker): + call(None, 'ansible-tests'), # http_agent + call(None, True), # force_basic_auth + call(None, 'all'), # follow_redirects +- call(None, '/tmp/client.pem'), # client_cert +- call(None, '/tmp/client.key'), # client_key ++ call(None, pem), # client_cert ++ call(None, client_key), # client_key + call(None, cookies), # cookies + call(None, '/foo/bar/baz.sock'), # unix_socket + call(None, pem), # ca_path +@@ -358,10 +359,7 @@ def test_Request_open_client_cert(urlopen_mock, install_opener_mock): + assert ssl_handler.client_cert == client_cert + assert ssl_handler.client_key == client_key + +- https_connection = ssl_handler._build_https_connection('ansible.com') +- +- assert https_connection.key_file == client_key +- assert https_connection.cert_file == client_cert ++ ssl_handler._build_https_connection('ansible.com') + + + def test_Request_open_cookies(urlopen_mock, install_opener_mock): From b04b988970037b6b93a8c5331700a7c83c2363b8 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Mon, 17 Jul 2023 21:48:57 -0500 Subject: [PATCH 10/18] Update to 2.14.8. --- .gitignore | 1 + ansible-core.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index df065cb..93d43f5 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ /ansible-core-2.14.5.tar.gz /ansible-core-2.14.6.tar.gz /ansible-core-2.14.7.tar.gz +/ansible-core-2.14.8.tar.gz diff --git a/ansible-core.spec b/ansible-core.spec index 5fb2913..a0ae53b 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -4,9 +4,9 @@ Name: ansible-core Summary: A radically simple IT automation system -Version: 2.14.7 +Version: 2.14.8 %global uversion %{version_no_tilde %{quote:%nil}} -Release: 2%{?dist} +Release: 1%{?dist} # The main license is GPLv3+. Many of the files in lib/ansible/module_utils # are BSD licensed. There are various files scattered throughout the codebase # containing code under different licenses. @@ -241,6 +241,9 @@ make PYTHON=%{python3} tests-py3 %changelog +* Tue Jul 18 2023 Maxwell G - 2.14.8-1 +- Update to 2.14.8. + * Mon Jul 10 2023 Maxwell G - 2.14.7-2 - Backport patch to make the `url` module_util compatible with Python 3.12 (Fedora 39+) hosts diff --git a/sources b/sources index d145537..9a56dfb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-core-2.14.7.tar.gz) = 5051c5cdc2655e0db595efc93d53bde3ce552378a8007257647a2298c9b0422550fff70f737803eb57aed852915264fd88a96dd2ce0e30ce839003c396e261d5 +SHA512 (ansible-core-2.14.8.tar.gz) = 23ef5dc4bccdf21d3e6d54ec7fcf2050230aad09e136e09af6c560119ac34c34df8da8144a7f963ae219900d23559c0bd45209af184c88fa7e5c6342b13aa256 From fa980e3a947f1d97ab65911cc758a257e56c5114 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Tue, 18 Jul 2023 14:14:27 +0000 Subject: [PATCH 11/18] Use the docs sources from ansible-documentation (cherry picked from commit b34a65757b685bbe4060c7e3cee88afed7c72343) --- .gitignore | 1 + ansible-core.spec | 11 +++++++---- sources | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 93d43f5..03090b1 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ /ansible-core-2.14.6.tar.gz /ansible-core-2.14.7.tar.gz /ansible-core-2.14.8.tar.gz +/ansible-documentation-2.14.8.tar.gz diff --git a/ansible-core.spec b/ansible-core.spec index a0ae53b..19f2cbf 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -11,7 +11,10 @@ Release: 1%{?dist} # are BSD licensed. There are various files scattered throughout the codebase # containing code under different licenses. License: GPL-3.0-or-later AND BSD-2-Clause AND PSF-2.0 AND MIT AND Apache-2.0 -Source: https://github.com/ansible/ansible/archive/v%{uversion}/%{name}-%{uversion}.tar.gz + +Source0: https://github.com/ansible/ansible/archive/v%{uversion}/%{name}-%{uversion}.tar.gz +Source1: https://github.com/ansible/ansible-documentation/archive/v%{uversion}/ansible-documentation-%{uversion}.tar.gz + Patch: https://github.com/ansible/ansible/commit/734f38b2594692707d1fd3cbcfc8dc8a677f4ee3.patch#/GALAXY_COLLECTIONS_PATH_WARNINGS.patch # urls - remove deprecated client key calls (#80751) # This is needed for Python 3.12, but we apply it unconditionally so @@ -97,7 +100,7 @@ This package installs extensive documentation for ansible-core %prep -%autosetup -p1 -n ansible-%{uversion} +%autosetup -p1 -n ansible-%{uversion} -a1 # ansible-test is executed directly by the Makefile, so we need to fix the shebang. sed -i -s 's|/usr/bin/env python|%{python3}|' \ @@ -234,9 +237,9 @@ make PYTHON=%{python3} tests-py3 %{_mandir}/man1/ansible* %files doc -%doc docs/docsite/rst +%doc ansible-documentation-%{uversion}/docs/docsite/rst %if %{with docs} -%doc docs/docsite/_build/html +%doc ansible-documentation-%{uversion}/docs/docsite/_build/html %endif diff --git a/sources b/sources index 9a56dfb..0df1918 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (ansible-core-2.14.8.tar.gz) = 23ef5dc4bccdf21d3e6d54ec7fcf2050230aad09e136e09af6c560119ac34c34df8da8144a7f963ae219900d23559c0bd45209af184c88fa7e5c6342b13aa256 +SHA512 (ansible-documentation-2.14.8.tar.gz) = 1b705aff10f96e4d17f7df495e873a8d8e4e2c182aae3f8f1949109a4957e161d8524a344a9ea972fa80e3713c6e7294fdc2e0e0796ccb6fa941fe21e9a608eb From 819b41778eb588f770e4ac58be8675b8f4a6adf7 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 17 Aug 2023 23:32:48 +0000 Subject: [PATCH 12/18] Use example files from ansible-documentation repo (cherry picked from commit 3d8a45c7359865ace71290ebb70d0831f964ebc0) --- ansible-core.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible-core.spec b/ansible-core.spec index 19f2cbf..e482566 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -204,8 +204,8 @@ done mkdir -p %{buildroot}%{_sysconfdir}/ansible/ mkdir -p %{buildroot}%{_sysconfdir}/ansible/roles/ -cp examples/hosts %{buildroot}/etc/ansible/ -cp examples/ansible.cfg %{buildroot}/etc/ansible/ +cp ansible-documentation-%{uversion}/examples/hosts %{buildroot}/etc/ansible/ +cp ansible-documentation-%{uversion}/examples/ansible.cfg %{buildroot}/etc/ansible/ mkdir -p %{buildroot}/%{_mandir}/man1 cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/ From bd4abcdfa44dee61d0741c6be26b218b77f27f33 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Sat, 19 Aug 2023 22:47:29 -0500 Subject: [PATCH 13/18] Update to 2.14.9. --- .gitignore | 2 ++ ansible-core.spec | 5 ++++- sources | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 03090b1..a991e73 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ /ansible-core-2.14.7.tar.gz /ansible-core-2.14.8.tar.gz /ansible-documentation-2.14.8.tar.gz +/ansible-core-2.14.9.tar.gz +/ansible-documentation-2.14.9.tar.gz diff --git a/ansible-core.spec b/ansible-core.spec index e482566..eb94418 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -4,7 +4,7 @@ Name: ansible-core Summary: A radically simple IT automation system -Version: 2.14.8 +Version: 2.14.9 %global uversion %{version_no_tilde %{quote:%nil}} Release: 1%{?dist} # The main license is GPLv3+. Many of the files in lib/ansible/module_utils @@ -244,6 +244,9 @@ make PYTHON=%{python3} tests-py3 %changelog +* Sun Aug 20 2023 Maxwell G - 2.14.9-1 +- Update to 2.14.9. + * Tue Jul 18 2023 Maxwell G - 2.14.8-1 - Update to 2.14.8. diff --git a/sources b/sources index 0df1918..620b77e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (ansible-core-2.14.8.tar.gz) = 23ef5dc4bccdf21d3e6d54ec7fcf2050230aad09e136e09af6c560119ac34c34df8da8144a7f963ae219900d23559c0bd45209af184c88fa7e5c6342b13aa256 -SHA512 (ansible-documentation-2.14.8.tar.gz) = 1b705aff10f96e4d17f7df495e873a8d8e4e2c182aae3f8f1949109a4957e161d8524a344a9ea972fa80e3713c6e7294fdc2e0e0796ccb6fa941fe21e9a608eb +SHA512 (ansible-core-2.14.9.tar.gz) = c3a05aaa98090cfbe73d8e9dee8b8f618bee9a57c67fa116cac24419e82bb938fab6dfe6be999c82a350ec8a1b23ef54439f336ed9d597416f2fa4006fcfbc2b +SHA512 (ansible-documentation-2.14.9.tar.gz) = 97346656f7988889cde81fccb65593807f0e1fe4b9f5d0d62d1ddedcfa5b19d1b89a5802c963dbc4798306a40f3fdb4f048d8789826b040d4e6e7f3a0669ac43 From db39a892490650fddd5bea086334e6406c0f395a Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 18 Aug 2023 00:17:06 +0000 Subject: [PATCH 14/18] Handle new upstream manpage building method (cherry picked from commit 66164773e060124fcba619657a4239fb2a524e00) --- ansible-core.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible-core.spec b/ansible-core.spec index eb94418..9d62a1a 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -123,7 +123,8 @@ sed '/^mock$/d' test/lib/ansible_test/_data/requirements/units.txt > _requiremen %pyproject_wheel # Build manpages -make PYTHON=%{python3} docs +mkdir -p docs/man/man1 +%{python3} packaging/cli-doc/build.py man --output-dir docs/man/man1 # Build shell completions ( From 94e7bf92a11c8f50d5891c3e4d489903eaf160d6 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Sun, 20 Aug 2023 03:53:08 +0000 Subject: [PATCH 15/18] Execute ansible-test directly instead of make The Makefile has been removed from the stable-2.14 branch. --- ansible-core.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible-core.spec b/ansible-core.spec index 9d62a1a..7c60c6a 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -220,8 +220,8 @@ install -Dpm 0644 licenses/* -t %{buildroot}%{_pkglicensedir} %check %if %{with tests} -ln -s /usr/bin/pytest-3 bin/pytest -make PYTHON=%{python3} tests-py3 +%{python3} bin/ansible-test \ + units --local --python-interpreter %{python3} %endif From a9ab6e3f4872fabaa70c4a17d2c4073674357f72 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Sun, 20 Aug 2023 03:56:49 +0000 Subject: [PATCH 16/18] Handle README.rst -> README.md change --- ansible-core.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-core.spec b/ansible-core.spec index 7c60c6a..bb4090f 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -228,7 +228,7 @@ install -Dpm 0644 licenses/* -t %{buildroot}%{_pkglicensedir} %files -f %{pyproject_files} %license COPYING %license %{_pkglicensedir}/{Apache-License,MIT-license,PSF-license,simplified_bsd}.txt -%doc README.rst changelogs/CHANGELOG-v2.1?.rst +%doc README.md changelogs/CHANGELOG-v2.1?.rst %dir %{_sysconfdir}/ansible/ %config(noreplace) %{_sysconfdir}/ansible/* %{_bindir}/ansible* From a8c72516a219e42a4bbed3207fbd6b003b4b0f33 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 13 Sep 2023 17:41:44 -0500 Subject: [PATCH 17/18] Update to 2.14.10. --- .gitignore | 2 ++ ansible-core.spec | 5 ++++- sources | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a991e73..bf8f86b 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ /ansible-documentation-2.14.8.tar.gz /ansible-core-2.14.9.tar.gz /ansible-documentation-2.14.9.tar.gz +/ansible-core-2.14.10.tar.gz +/ansible-documentation-2.14.10.tar.gz diff --git a/ansible-core.spec b/ansible-core.spec index bb4090f..e73013f 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -4,7 +4,7 @@ Name: ansible-core Summary: A radically simple IT automation system -Version: 2.14.9 +Version: 2.14.10 %global uversion %{version_no_tilde %{quote:%nil}} Release: 1%{?dist} # The main license is GPLv3+. Many of the files in lib/ansible/module_utils @@ -245,6 +245,9 @@ install -Dpm 0644 licenses/* -t %{buildroot}%{_pkglicensedir} %changelog +* Wed Sep 13 2023 Maxwell G - 2.14.10-1 +- Update to 2.14.10. + * Sun Aug 20 2023 Maxwell G - 2.14.9-1 - Update to 2.14.9. diff --git a/sources b/sources index 620b77e..2c11471 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (ansible-core-2.14.9.tar.gz) = c3a05aaa98090cfbe73d8e9dee8b8f618bee9a57c67fa116cac24419e82bb938fab6dfe6be999c82a350ec8a1b23ef54439f336ed9d597416f2fa4006fcfbc2b -SHA512 (ansible-documentation-2.14.9.tar.gz) = 97346656f7988889cde81fccb65593807f0e1fe4b9f5d0d62d1ddedcfa5b19d1b89a5802c963dbc4798306a40f3fdb4f048d8789826b040d4e6e7f3a0669ac43 +SHA512 (ansible-core-2.14.10.tar.gz) = b85f92c09f56969eb8a400ba51cdcf67c77ac7d6049a2c4b66f9984bfa6ff6f2259976e352105faa4f90449cef5d8c574067b38198b120b451033527aac3a91e +SHA512 (ansible-documentation-2.14.10.tar.gz) = 3f68b09a4e7a757bbec7573099f3a73e4e2a78d73940785b155327ad060cc7bfd7b5d0d8a11d441e4d692d861009ebc80433b167a93ca4e5fab84657ddada7de From 75857a2924c74ffea79ab391cd4b4dce215f2c07 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 11 Oct 2023 23:35:24 -0500 Subject: [PATCH 18/18] Update to 2.14.11. --- .gitignore | 2 ++ ansible-core.spec | 5 ++++- sources | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index bf8f86b..6bd7cc7 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ /ansible-documentation-2.14.9.tar.gz /ansible-core-2.14.10.tar.gz /ansible-documentation-2.14.10.tar.gz +/ansible-core-2.14.11.tar.gz +/ansible-documentation-2.14.11.tar.gz diff --git a/ansible-core.spec b/ansible-core.spec index e73013f..0b482a6 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -4,7 +4,7 @@ Name: ansible-core Summary: A radically simple IT automation system -Version: 2.14.10 +Version: 2.14.11 %global uversion %{version_no_tilde %{quote:%nil}} Release: 1%{?dist} # The main license is GPLv3+. Many of the files in lib/ansible/module_utils @@ -245,6 +245,9 @@ install -Dpm 0644 licenses/* -t %{buildroot}%{_pkglicensedir} %changelog +* Thu Oct 12 2023 Maxwell G - 2.14.11-1 +- Update to 2.14.11. + * Wed Sep 13 2023 Maxwell G - 2.14.10-1 - Update to 2.14.10. diff --git a/sources b/sources index 2c11471..2ec8a8f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (ansible-core-2.14.10.tar.gz) = b85f92c09f56969eb8a400ba51cdcf67c77ac7d6049a2c4b66f9984bfa6ff6f2259976e352105faa4f90449cef5d8c574067b38198b120b451033527aac3a91e -SHA512 (ansible-documentation-2.14.10.tar.gz) = 3f68b09a4e7a757bbec7573099f3a73e4e2a78d73940785b155327ad060cc7bfd7b5d0d8a11d441e4d692d861009ebc80433b167a93ca4e5fab84657ddada7de +SHA512 (ansible-core-2.14.11.tar.gz) = 4246b0fcab2e89ff2e905c582b03dc4c05a2db29aaac72d9ce75a88edeb0ba3a2b5baee2756adf19b98af5516db4c0dca96c46f8d30d0029cbb37232dc197ee2 +SHA512 (ansible-documentation-2.14.11.tar.gz) = 40261e647092048b398a825abcdcc0b7fed51cabdb0c3e1b5f403ecc36ee7c289f41fec5fe4065ff0b955cf24db56914d61749525922b36f6fc6e606c5e975ad