Compare commits

...

No commits in common. "c8s" and "c9-beta" have entirely different histories.
c8s ... c9-beta

11 changed files with 127 additions and 494 deletions

4
.ansible-core.metadata Normal file
View File

@ -0,0 +1,4 @@
560f248ccb0b98256c5b50c86a002c2c1e57edb6 SOURCES/Jinja2-3.1.2.tar.gz
192b9f6598e1ae036301f72781973c6f46e50aa2 SOURCES/MarkupSafe-2.1.2.tar.gz
5d229969295e19025ea93e5e8782017db4c6ae52 SOURCES/ansible-documentation-2.14.17.tar.gz
8d8ed49ed9a2df81faa2fe67b3f1e4c981641330 SOURCES/ansible_core-2.14.18.tar.gz

30
.gitignore vendored
View File

@ -1,28 +1,4 @@
SOURCES/Jinja2-3.1.2.tar.gz
SOURCES/MarkupSafe-2.1.0.tar.gz
SOURCES/ansible-core-2.14.2.tar.gz
SOURCES/packaging-20.4.tar.gz
SOURCES/pyparsing-2.4.7.tar.gz
SOURCES/resolvelib-0.5.4.tar.gz
/Jinja2-3.1.2.tar.gz
/MarkupSafe-2.1.0.tar.gz
/ansible-core-2.14.2.tar.gz
/packaging-20.4.tar.gz
/pyparsing-2.4.7.tar.gz
/resolvelib-0.5.4.tar.gz
/MarkupSafe-2.1.2.tar.gz
/ansible-core-2.15.0.tar.gz
/packaging-21.3.tar.gz
/pyparsing-3.0.7.tar.gz
/resolvelib-1.0.1.tar.gz
/ansible-core-2.15.1.tar.gz
/ansible-core-2.15.2.tar.gz
/ansible-core-2.15.3.tar.gz
/ansible-documentation-2.15.3.tar.gz
/docutils-0.20.1.tar.gz
/ansible-core-2.16.1.tar.gz
/ansible-documentation-2.16.1.tar.gz
/ansible-core-2.16.2.tar.gz
/ansible-documentation-2.16.2.tar.gz
/ansible-core-2.16.3.tar.gz
/ansible-documentation-2.16.3.tar.gz
SOURCES/MarkupSafe-2.1.2.tar.gz
SOURCES/ansible-documentation-2.14.17.tar.gz
SOURCES/ansible_core-2.14.18.tar.gz

View File

@ -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/.*

View File

@ -0,0 +1,12 @@
diff --git a/requirements.txt b/requirements.txt
index 20562c3e0f..b24f27b2ca 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,7 +3,6 @@
# packages. Thus, this should be the loosest set possible (only required
# packages, not optional ones, and with the widest range of versions that could
# be suitable)
-jinja2 >= 3.0.0
PyYAML >= 5.1 # PyYAML 5.1 is required for Python 3.8+ support
cryptography
packaging

View File

@ -1,6 +1,3 @@
%global __python3 /usr/bin/python3.12
%global python3_pkgversion 3.12
# 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.
@ -10,10 +7,6 @@
# ansible-test munges the shebangs itself.
%global __brp_mangle_shebangs_exclude_from_file %{SOURCE2}
# 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$
# 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
# install libraries on their own to use. For instance, paramiko for the
@ -27,35 +20,26 @@
%define vendor_pip %{__python3} -m pip install --no-deps -v --no-build-isolation --no-binary :all: -t %{vendor_path}
# These control which bundled dep versions we pin against
%global docutils_version 0.20.1
%global doc_version 2.14.17
%global jinja2_version 3.1.2
%global markupsafe_version 2.1.2
%global packaging_version 21.3
%global pyparsing_version 3.0.7
%global resolvelib_version 1.0.1
Name: ansible-core
Summary: SSH-based configuration management, deployment, and task execution system
Version: 2.16.3
Epoch: 1
Version: 2.14.18
Release: 3%{?dist}
ExcludeArch: i686
Group: Development/Libraries
License: GPLv3+
Source0: https://files.pythonhosted.org/packages/source/a/ansible-core/ansible-core-%{version}.tar.gz
Source1: https://github.com/ansible/ansible-documentation/archive/v%{version}/ansible-documentation-%{version}.tar.gz
Source0: https://files.pythonhosted.org/packages/source/a/ansible-core/ansible_core-%{version}.tar.gz
Source1: https://github.com/ansible/ansible-documentation/archive/v%{doc_version}/ansible-documentation-%{doc_version}.tar.gz
Source2: ansible-test-data-files.txt
# And bundled deps
Source3: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{jinja2_version}.tar.gz
Source4: https://files.pythonhosted.org/packages/source/M/MarkupSafe/MarkupSafe-%{markupsafe_version}.tar.gz
Source5: https://files.pythonhosted.org/packages/source/p/packaging/packaging-%{packaging_version}.tar.gz
Source6: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%{pyparsing_version}.tar.gz
Source7: https://files.pythonhosted.org/packages/source/r/resolvelib/resolvelib-%{resolvelib_version}.tar.gz
# Deps to build manpages
Source8: https://sourceforge.net/projects/docutils/files/docutils/%{docutils_version}/docutils-%{docutils_version}.tar.gz
Patch0: remove-bundled-deps-from-requirements.patch
@ -66,9 +50,9 @@ Patch99: telemetry.patch
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 < 2.11.0
# ... and provide 'ansible' so that old packages still work without updated
# spec files.
@ -83,11 +67,9 @@ 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-resolvelib) = %{resolvelib_version}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-docutils
BuildRequires: python%{python3_pkgversion}-pip
BuildRequires: python%{python3_pkgversion}-pyyaml
BuildRequires: python%{python3_pkgversion}-rpm-macros
@ -98,6 +80,9 @@ BuildRequires: make git-core gcc
Requires: git-core
Requires: python%{python3_pkgversion}-PyYAML >= 5.1
Requires: python%{python3_pkgversion}-cryptography
Requires: python%{python3_pkgversion}-packaging
Requires: python%{python3_pkgversion}-resolvelib >= 0.5.3
Requires: python%{python3_pkgversion}-resolvelib < 0.9.0
Requires: sshpass
%description
@ -109,7 +94,7 @@ are transferred to managed machines automatically.
%package -n ansible-test
Summary: Tool for testing ansible plugin and module code
Requires: %{name} = %{version}-%{release}
Requires: %{name} = %{epoch}:%{version}-%{release}
%description -n ansible-test
Ansible is a radically simple model-driven configuration management,
@ -122,14 +107,15 @@ This package installs the ansible-test command for testing modules and plugins
developed for ansible.
%prep
%setup -q -b1 -b3 -b4 -b5 -b6 -b7 -b8 -n ansible-core-%{version}
%setup -q -b1 -b3 -b4 -n ansible_core-%{version}
%patch0 -p1
# Fix all Python shebangs recursively in ansible-test
%{py3_shebang_fix} test/lib/ansible_test
%if 0%{!?centos:1} && 0%{?rhel}
%patch -P99 -p1
%patch99 -p1
%{py3_shebang_fix} %{SOURCE99}
%endif
%build
@ -141,10 +127,7 @@ developed for ansible.
# Handle bundled deps:
%{vendor_pip} \
../Jinja2-%{jinja2_version}/ \
../MarkupSafe-%{markupsafe_version}/ \
../packaging-%{packaging_version}/ \
../pyparsing-%{pyparsing_version}/ \
../resolvelib-%{resolvelib_version}
../MarkupSafe-%{markupsafe_version}/
# Create system directories that Ansible defines as default locations in
# ansible/config/base.yml
@ -183,8 +166,8 @@ done
mkdir -p %{buildroot}%{_sysconfdir}/ansible/
mkdir -p %{buildroot}%{_sysconfdir}/ansible/roles/
cp ../ansible-documentation-%{version}/examples/hosts %{buildroot}%{_sysconfdir}/ansible/
cp ../ansible-documentation-%{version}/examples/ansible.cfg %{buildroot}%{_sysconfdir}/ansible/
cp ../ansible-documentation-%{doc_version}/examples/hosts %{buildroot}%{_sysconfdir}/ansible/
cp ../ansible-documentation-%{doc_version}/examples/ansible.cfg %{buildroot}%{_sysconfdir}/ansible/
%if 0%{!?centos:1} && 0%{?rhel}
mkdir -p %{buildroot}%{_datadir}/ansible/telemetry
@ -195,14 +178,11 @@ cp %{SOURCE99} %{buildroot}%{_datadir}/ansible/telemetry/
mkdir -p %{buildroot}/%{_mandir}/man1/
mkdir -p docs/man/man1
mkdir -p /tmp/_docutils
%{__python3} -m pip install ../docutils-%{docutils_version} -t /tmp/_docutils --no-build-isolation
PYTHONPATH=%{vendor_path}:/tmp/_docutils %{__python3} packaging/cli-doc/build.py man --output-dir docs/man/man1
rm -rf /tmp/_docutils
PYTHONPATH=%{vendor_path} %{__python3} packaging/cli-doc/build.py man --output-dir docs/man/man1
cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/
cp -pr ../ansible-documentation-%{version}/docs/docsite/rst .
cp -pr ../ansible-documentation-%{doc_version}/docs/docsite/rst .
cp -p lib/ansible_core.egg-info/PKG-INFO .
strip --strip-unneeded %{vendor_path}/markupsafe/_speedups%{python3_ext_suffix}
@ -212,7 +192,8 @@ strip --strip-unneeded %{vendor_path}/markupsafe/_speedups%{python3_ext_suffix}
%{_bindir}/ansible*
%exclude %{_bindir}/ansible-test
%config(noreplace) %{_sysconfdir}/ansible/
%doc README.md PKG-INFO COPYING
%license COPYING
%doc README.md PKG-INFO
%doc changelogs/CHANGELOG-v2.*.rst
%doc %{_mandir}/man1/ansible*
%{_datadir}/ansible/
@ -224,121 +205,143 @@ strip --strip-unneeded %{vendor_path}/markupsafe/_speedups%{python3_ext_suffix}
%{_bindir}/ansible-test
%{python3_sitelib}/ansible_test
%changelog
* Wed Jul 29 2026 Dimitri Savineau <dsavinea@redhat.com> - 2.16.3-3
- Add telemetry for RHEL (RHEL-219532)
* Tue Feb 10 2026 Dimitri Savineau <dsavinea@redhat.com> - 1:2.14.18-3
- Fix selinux AVC denial when telemetry is enabled (RHEL-148293)
* Mon Feb 05 2024 Dimitri Savineau <dsavinea@redhat.com> - 2.16.3-2
- rebuild with python 3.12 (RHEL-24141)
* Thu Oct 30 2025 Dimitri Savineau <dsavinea@redhat.com> - 1:2.14.18-2
- Add telemetry for RHEL (RHEL-123003)
* Fri Feb 02 2024 Dimitri Savineau <dsavinea@redhat.com> - 2.16.3-1
- ansible-core 2.16.3 release (RHEL-23782)
* Fri Jan 03 2025 Dimitri Savineau <dsavinea@redhat.com> - 1:2.14.18-1
- ansible-core 2.14.18 release (RHEL-69086)
- Fix license file path
* Thu May 23 2024 Dimitri Savineau <dsavinea@redhat.com> - 1:2.14.17-1
- ansible-core 2.14.17 release (RHEL-38539)
* Fri Feb 02 2024 Dimitri Savineau <dsavinea@redhat.com> - 1:2.14.14-1
- ansible-core 2.14.14 release (RHEL-23783)
- Fix CVE-2024-0690 (possible information leak in tasks that ignore
ANSIBLE_NO_LOG configuration) (RHEL-22123)
ANSIBLE_NO_LOG configuration) (RHEL-22124)
* Tue Dec 12 2023 Dimitri Savineau <dsavinea@redhat.com> - 2.16.2-1
- ansible-core 2.16.2 release (RHEL-19297)
* Tue Dec 12 2023 Dimitri Savineau <dsavinea@redhat.com> - 1:2.14.13-1
- ansible-core 2.14.13 release (RHEL-19298)
* Thu Dec 07 2023 Dimitri Savineau <dsavinea@redhat.com> - 2.16.1-1
- ansible-core 2.16.1 release (RHEL-18965)
* Thu Dec 07 2023 Dimitri Savineau <dsavinea@redhat.com> - 1:2.14.12-1
- ansible-core 2.14.12 release (RHEL-18950)
* Wed Aug 16 2023 Dimitri Savineau <dsavinea@redhat.com> - 2.15.3-1
- ansible-core 2.15.3 release (rhbz#2232431)
* Wed Aug 16 2023 Dimitri Savineau <dsavinea@redhat.com> - 1:2.14.9-1
- ansible-core 2.14.9 release (rhbz#2232432)
- Use docs and examples from ansible-documentation project.
- Build the manpages.
* Mon Aug 14 2023 Dimitri Savineau <dsavinea@redhat.com> - 2.15.2-1
- ansible-core 2.15.2 release (rhbz#2231891)
* Mon Aug 14 2023 Dimitri Savineau <dsavinea@redhat.com> - 1:2.14.8-1
- ansible-core 2.14.8 release (rhbz#2231892)
* Mon Jul 17 2023 Dimitri Savineau <dsavinea@redhat.com> - 1:2.14.7-1
- ansible-core 2.14.7 release (rhbz#2221820)
- rebuild with python 3.9 (rhbz#2221820)
- remove bundled packaging, pyparsing and resolvelib.
* Tue Jul 04 2023 Dimitri Savineau <dsavinea@redhat.com> - 2.15.1-1
- ansible-core 2.15.1 release (rhbz#2219620)
- ansible-core 2.15.1 release (rhbz#2219619)
* Mon May 15 2023 Dimitri Savineau <dsavinea@redhat.com> - 2.15.0-1
- ansible-core 2.15.0 release (rhbz#2204511)
- ansible-core 2.15.0 release (rhbz#2204510)
- update bundled markupsafe to 2.1.2.
- update bundled packaging to 21.3.
- update bundled pyparsing to 3.0.7.
- update bundled resolvelib to 1.0.1.
- remove six runtime dependency.
* Tue Feb 14 2023 Dimitri Savineau <dsavinea@redhat.com> - 2.14.2-3
- rebuild with python 3.11 (rhbz#2169524)
- remove bundled dependencies from requirements file (rhbz#2143974)
- use PyPi sources (rhbz#2160277)
* Mon Feb 13 2023 Dimitri Savineau <dsavinea@redhat.com> - 2.14.2-4
- rebuild with python 3.11 (rhbz#2169466)
- remove bundled dependencies from requirements file (rhbz#2152615)
- add bundled version of resolvelib
- use PyPi sources
- remove straightplugin
- add missing obsoletes constraint
* Thu Feb 02 2023 Christian Adams <chadams@redhat.com> - 2.14.2-2
- fix debuginfo symbols from markupsafe dependency (rhbz#2166414)
* Wed Feb 01 2023 Dimitri Savineau <dsavinea@redhat.com> - 2.14.2-3
- fix debuginfo symbols from markupsafe dependency (rhbz#2166433)
* Wed Feb 01 2023 Christian Adams <chadams@redhat.com> - 2.14.2-1
- ansible-core 2.14.2 release (rhbz#2166414)
* Wed Feb 01 2023 Christian Adams <chadams@redhat.com> - 2.14.2-2
- fix bogus date in changelog (rhbz#2165763)
* Tue Jan 31 2023 Christian Adams <chadams@redhat.com> - 2.14.2-1
- ansible-core 2.14.2 release (rhbz#2165763)
* Wed Dec 07 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.14.1-1
- ansible-core 2.14.1 release (rhbz#2151594)
- ansible-core 2.14.1 release (rhbz#2151593)
* Tue Nov 08 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.14.0-1
- ansible-core 2.14.0 release (rhbz#2141386)
- ansible-core 2.14.0 release (rhbz#2141116)
* Mon Nov 07 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.6-1
- ansible-core 2.13.6 release (rhbz#2141109)
- fix service_facts module parsing (rhbz#2141111)
- ansible-core 2.13.6 release (rhbz#2140778)
- fix service_facts module parsing (rhbz#2128801)
* Wed Oct 12 2022 James Marshall <jamarsha@redhat.com> - 2.13.5-1
- ansible-core 2.13.5 release (rhbz#2134116)
* Tue Oct 11 2022 James Marshall <jamarsha@redhat.com> - 2.13.5-1
- ansible-core 2.13.5 release (rhbz#2133912)
* Fri Oct 07 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.4-1
- ansible-core 2.13.4 release (rhbz#2133024)
* Thu Oct 06 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.4-1
- ansible-core 2.13.4 release (rhbz#2132807)
* Mon Aug 15 2022 James Marshall <jamarsha@redhat.com> - 2.13.3-1
- ansible-core 2.13.3 release (rhbz#2118475)
- ansible-core 2.13.3 release (rhbz#2118458)
* Wed Jul 20 2022 James Marshall <jamarsha@redhat.com> - 2.13.2-1
- ansible-core 2.13.2 release (rhbz#2109192)
* Mon Jul 18 2022 James Marshall <jamarsha@redhat.com> - 2.13.2-1
- ansible-core 2.13.2 release (rhbz#2108229)
* Mon Jul 04 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.1-1
- ansible-core 2.13.1 release (rhbz#2103699)
- add bundled version of jinja2, markupsafe and resolvelib
- rebuild with python 3.9
* Mon Jun 27 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.1-2
- Update bundled jinja2 version to 3.1.2 (rhbz#2101462)
* Wed Jun 22 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.1-1
- ansible-core 2.13.1 release (rhbz#2100242)
- add bundled version of jinja2 and markupsafe
* Mon Jun 20 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.7-1
- ansible-core 2.12.7 release (rhbz#2099323)
* Thu Jun 09 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.6-3
- Build manpages (rhbz#2032809)
- Remove legacy files
* Tue Jun 07 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.6-2
- switch from git to git-core dependency (rhbz#2094549)
- ansible-core 2.12.7 release (rhbz#2099317)
- remove legacy nightly configuration
* Tue May 24 2022 James Marshall <jamarsha@redhat.com> - 2.12.6-1
- ansible-core 2.12.6 release
* Fri May 13 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.5-2
- switch from git to git-core dependency (rhbz#2083386)
* Mon May 09 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.5-1
- ansible-core 2.12.5 release
* Mon Apr 11 2022 James Marshall <jamarsha@redhat.com> - 2.12.4-1
* Wed Apr 06 2022 James Marshall <jamarsha@redhat.com> - 2.12.4-1
- ansible-core 2.12.4 release
* Mon Mar 14 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.3-1
- ansible-core 2.12.3 release
- re-enable changelog and manpages
* Mon Mar 07 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.2-3
- replace Obsolete to Conflicts
* Wed Feb 02 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.2-2
- fix ansible tarball setup
* Wed Feb 02 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.2-1
* Tue Feb 01 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.2-1
- ansible-core 2.12.2 release
- add gating and test files
* Wed Jan 19 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.1-2
- Remove Provides on ansible
* Thu Dec 16 2021 Yanis Guenane <yguenane@redhat.com> - 2.12.1-1
* Tue Dec 07 2021 James Marshall <jamarsha@redhat.com> - 2.12.1-1
- ansible-core 2.12.1-1
* Mon Nov 08 2021 Dimitri Savineau <dsavinea@redhat.com> - 2.12.0-1
- ansible-core 2.12.0-1
* Tue Oct 12 2021 Christian Adams <chadams@redhat.com> - 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 <yguenane@redhat.com> - 2.11.5-3
- ansible-core 2.11.5-3, add virtual provide for straightplugin
* Wed Sep 15 2021 Josh Boyer <jwboyer@redhat.com> - 2.11.5-2
- ansible-core 2.11.5-2
* Mon Sep 13 2021 Josh Boyer <jwboyer@redhat.com> - 2.11.3-3
- Bump for build
* Wed Jul 21 2021 Paul Belanger <pabelanger@redhat.com> - 2.11.3-2
- Add git dependency for ansible-galaxy CLI command.

View File

@ -1,6 +0,0 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -1,18 +0,0 @@
diff --git a/requirements.txt b/requirements.txt
index 5eaf9f2cbc..792daa209a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,13 +3,5 @@
# packages. Thus, this should be the loosest set possible (only required
# packages, not optional ones, and with the widest range of versions that could
# be suitable)
-jinja2 >= 3.0.0
PyYAML >= 5.1 # PyYAML 5.1 is required for Python 3.8+ support
cryptography
-packaging
-# NOTE: resolvelib 0.x version bumps should be considered major/breaking
-# NOTE: and we should update the upper cap with care, at least until 1.0
-# NOTE: Ref: https://github.com/sarugaku/resolvelib/issues/69
-# NOTE: When updating the upper bound, also update the latest version used
-# NOTE: in the ansible-galaxy-collection test suite.
-resolvelib >= 0.5.3, < 1.1.0 # dependency resolver used by ansible-galaxy

View File

@ -1,8 +0,0 @@
SHA512 (ansible-core-2.16.3.tar.gz) = 62b7d23d3d639f118a4b87dccc02ec5f373fd56ae6c5fb56c8adf0818d0f5bbf3b6de47a29da9ef2d8c3f4b7e3a99978677bc9bfda1eb4cb9640b79abb763f77
SHA512 (ansible-documentation-2.16.3.tar.gz) = c073b0b961e38bee560be78e2c12534facec891f6e375df14fdcaf99241f711cf6955ee58b936f7f23ab62a732d2dbde5fd279976989be06e747c2bf3db41661
SHA512 (docutils-0.20.1.tar.gz) = a0ddca315d03677003036d6a8052ac96fbd3fcc4508564938ea684d79bedb4d322d83449c7b26e55b19b0aadd6e46ca9ac409bb16279a20f06c70e9c15ef5eb0
SHA512 (Jinja2-3.1.2.tar.gz) = 5dfe122c1beef5305b34d25f22f96607bd3a6cba098b03091850ea36fefe62b645a7218d7584b35bea252393ac922c9bb3654a9e90f23bcfb273e811fcf2f2c1
SHA512 (MarkupSafe-2.1.2.tar.gz) = 84dbeddaf2df713b3cce94eb64876fea8f80c608e25130c18e4691be2b1dea56df8b772d26c0caca88231ef795125eb9678210c33bf20518c18e3047912ddb4b
SHA512 (packaging-21.3.tar.gz) = 2e3aa276a4229ac7dc0654d586799473ced9761a83aa4159660d37ae1a2a8f30e987248dd0e260e2834106b589f259a57ce9936eef0dcc3c430a99ac6b663e05
SHA512 (pyparsing-3.0.7.tar.gz) = 1e692f4cdaa6b6e8ca2729d0a3e2ba16d978f1957c538b6de3a4220ec7d996bdbe87c41c43abab851fffa3b0498a05841373e435602917b8c095042e273badb5
SHA512 (resolvelib-1.0.1.tar.gz) = 52c872fb2a22c47de022a661dc4d8de8c6af450f1cff6f2b99cd91bf7eccae5b6ee223793f50b9679c1c6caedbd8bb63330915ee6f10533b1a0ed239d068b36f

View File

@ -1,13 +0,0 @@
diff --git a/lib/ansible/plugins/loader.py b/lib/ansible/plugins/loader.py
index f3252d7142..1e4d3bca38 100644
--- a/lib/ansible/plugins/loader.py
+++ b/lib/ansible/plugins/loader.py
@@ -1532,7 +1532,7 @@ cache_loader = PluginLoader(
callback_loader = PluginLoader(
'CallbackModule',
'ansible.plugins.callback',
- C.DEFAULT_CALLBACK_PLUGIN_PATH,
+ C.DEFAULT_CALLBACK_PLUGIN_PATH + ['/usr/share/ansible/telemetry'],
'callback_plugins',
)

View File

@ -1,302 +0,0 @@
#! /usr/libexec/platform-python
# Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = '''
name: telemetry
short_description: Track various telemetry related data and store in journald
description:
- Track various telemetry related data and store in journald
type: aggregate
options:
bypass_insights_check:
name: Bypass Insights Check
description: Bypass check to see if insights-client is active
default: false
type: bool
env:
- name: TELEMETRY_BYPASS_INSIGHTS_CHECK
notes:
- The file can also be executed directly from the CLI to retrieve
the stored telemetry data from journald
'''
import contextlib
import ctypes
import datetime
import functools
import importlib.util
import json
import os
import pathlib
import subprocess
import sys
import uuid
from collections import Counter, defaultdict
if __name__ == '__main__':
# When run as a script via insights-client, these are not needed
CallbackBase = object
Display = None
else:
from ansible.executor.task_result import TaskResult
from ansible.module_utils.common.yaml import yaml_load
from ansible.plugins.callback import CallbackBase
from ansible.plugins.loader import connection_loader
from ansible.release import __version__ as ansible_version
from ansible.utils.display import Display
journal_sendv = None
try:
from systemd import journal
journal_sendv = journal.sendv
except ImportError:
# When invoked using the non-system python
# the systemd python bindings are not available
with contextlib.suppress(AttributeError, OSError):
_libsysetmd = ctypes.CDLL('libsystemd.so.0')
sd_journal_send = _libsysetmd.sd_journal_send
def journal_sendv(*args):
b_args = [ctypes.c_char_p(a.encode()) for a in args] + [None]
sd_journal_send(*b_args)
if sys.version_info >= (3, 10):
from importlib.resources import files
else:
# importlib.resources below Python 3.10 doesn't support
# custom loaders, this is not a full featured replacement
# but suffices for the needs of this plugin
def files(name):
spec = importlib.util.find_spec(name)
if spec is None:
raise ImportError(name)
origin = pathlib.Path(spec.origin)
if origin.name == '__synthetic__':
origin = origin.parent
return origin
if Display:
display = Display()
_CORE_SYN_COLLECTIONS = frozenset((
'ansible.builtin',
'ansible.legacy',
))
_CORE_FACT_MODULES = frozenset((
'setup',
'ansible.builtin.setup',
'ansible.legacy.setup',
'gather_facts',
'ansible.builtin.gather_facts',
'ansible.legacy.gather_facts',
))
_ANSIBLE_TELEMETRY_MESSAGE_ID = uuid.UUID('73df9e03d8c6473eb811065c4ebc370a')
@functools.lru_cache(maxsize=None)
def _get_connection_fqcn(task, host):
connection = host.vars.get('ansible_connection')
if not connection:
connection = task.connection
is_connection_fqcn = '.' in connection
if is_connection_fqcn:
return connection
return connection_loader.get_with_context(
connection,
class_only=True,
collection_list=task.collections,
).plugin_load_context.resolved_fqcn
class CallbackModule(CallbackBase):
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = 'aggregate'
CALLBACK_NAME = 'telemetry'
def __init__(self, *args, **kwargs):
self.wants_implicit_tasks = False
self.disabled = False
self._telemetry = {
'collections': defaultdict(
lambda: {
'resources': defaultdict(
lambda: defaultdict(lambda: {
'count': 0,
})
),
'version': '*',
},
),
}
self._hosts = set()
self._os = {}
self._conn_cache = {}
def _is_insights_client_active(self):
if self.get_option('bypass_insights_check'):
return True
if not os.path.exists('/etc/insights-client/.registered'):
return False
with contextlib.suppress(subprocess.CalledProcessError):
subprocess.run(
['systemctl', 'is-active', '--quiet', 'insights-client.timer'],
capture_output=True,
check=True,
)
return True
return False
def _set_disabled(self):
if not self._is_insights_client_active():
return True
if journal_sendv is None:
return True
return False
def set_options(self, task_keys=None, var_options=None, direct=None):
super().set_options(task_keys=task_keys, var_options=var_options, direct=direct)
self.disabled = self._set_disabled()
def _track_os(self, host_name, result):
if host_name in self._os:
return
try:
af = result.get('ansible_facts')
except AttributeError:
return
if not af:
return
try:
os_name = '%(ansible_distribution)s-%(ansible_distribution_version)s' % af
except KeyError:
return
else:
self._os[host_name] = os_name
def _handle_result(self, *args, **kwargs):
if not args:
return
result = args[0]
if not isinstance(result, TaskResult):
return
host = result._host
host_name = host.get_name()
task = result._task
role = task._role
self._hosts.add(host_name)
action = task.resolved_action
action_collection = None
if action and '.' in action:
action_collection = '.'.join(action.split('.', 2)[:2])
if action in _CORE_FACT_MODULES:
self._track_os(host_name, result._result)
role_collection = None
role_name = None if not role else role.get_name()
if role and '.' in role_name:
role_collection = '.'.join(role_name.split('.', 2)[:2])
connection_collection = None
connection = _get_connection_fqcn(task, host)
if '.' in connection:
connection_collection = '.'.join(connection.split('.')[:2])
collections = self._telemetry['collections']
for resource, collection, name in (('action', action_collection, action),
('role', role_collection, role_name),
('connection', connection_collection, connection)):
if not collection:
continue
collections[collection]['resources'][resource][name]['count'] += 1
# v2_on_file_diff = _handle_result
v2_runner_item_on_failed = _handle_result
v2_runner_item_on_ok = _handle_result
v2_runner_item_on_skipped = _handle_result
v2_runner_on_async_failed = _handle_result
v2_runner_on_async_ok = _handle_result
v2_runner_on_async_poll = _handle_result
v2_runner_on_failed = _handle_result
v2_runner_on_ok = _handle_result
v2_runner_on_skipped = _handle_result
v2_runner_on_unreachable = _handle_result
v2_runner_retry = _handle_result
def v2_playbook_on_stats(self, stats):
self._telemetry['ansible_core'] = {
'version': ansible_version,
}
self._telemetry['hosts'] = {
'count': len(self._hosts),
'os': Counter(self._os.values()),
}
for collection in self._telemetry['collections']:
if collection in _CORE_SYN_COLLECTIONS:
continue
cpath = files('ansible_collections.%s' % collection)
for candidate in ('METADATA.json', 'galaxy.yml'):
mdfile = cpath.joinpath(candidate)
if mdfile.exists():
self._telemetry['collections'][collection]['version'] = yaml_load(
mdfile.read_text()
).get('version', '*')
break
with contextlib.suppress(Exception):
self._write_journal()
def _write_journal(self):
journal_sendv(
'MESSAGE=%s' % json.dumps(self._telemetry, separators=(',', ':')),
'MESSAGE_ID=%s' % _ANSIBLE_TELEMETRY_MESSAGE_ID.hex,
'ANSIBLE_TELEMETRY=core',
'ANSIBLE_TELEMETRY_ID=%s' % uuid.uuid4().hex,
)
@contextlib.contextmanager
def _get_journal_reader(seek=None):
with journal.Reader() as j:
if seek:
j.seek_realtime(seek)
j.add_match('MESSAGE_ID=%s' % _ANSIBLE_TELEMETRY_MESSAGE_ID.hex)
j.add_match('ANSIBLE_TELEMETRY=core')
yield j
def main():
lastupload_file = pathlib.Path('/etc/insights-client/.lastupload')
lastupload = None
with contextlib.suppress(ValueError, OSError):
lastupload = datetime.datetime.strptime(
lastupload_file.read_text(),
'%Y-%m-%dT%H:%M:%S.%f'
)
with _get_journal_reader(lastupload) as j:
for entry in j:
print(entry['MESSAGE'])
if __name__ == '__main__':
main()

View File

@ -1,16 +0,0 @@
---
- hosts: localhost
gather_facts: yes
roles:
- role: standard-test-basic
tags:
- classic
tests:
- simple:
dir: .
run: /usr/bin/ansible localhost -m dnf -a "list=installed"
# tasks:
# This is only used as part of rpm-ostree which has extensive tests
# and there is no point to testing it separately.
# - name: true
# shell: true