0fdcc6
%global __python3 /usr/bin/python3.11
0fdcc6
%global python3_pkgversion 3.11
0fdcc6
6f8f29
# We need this because we are no longer noarch, since our bundled deps might
6f8f29
# conceivably need to compile arch-specific things. But we currently have no
6f8f29
# useful debuginfo stuff.
6f8f29
%global debug_package %{nil}
6f8f29
6f8f29
# Disable shebang munging for specific paths.  These files are data files.
6f8f29
# ansible-test munges the shebangs itself.
6f8f29
%global __brp_mangle_shebangs_exclude_from_file %{SOURCE1}
6f8f29
6f8f29
# NOTE(pabelanger): Don't auto add pwsh as Requires for ansible-test. We do
6f8f29
# not wish to package it.
6f8f29
%global __requires_exclude ^/usr/bin/pwsh$
6f8f29
6f8f29
# RHEL and Fedora add -s to the shebang line.  We do *not* use -s -E -S or -I
6f8f29
# with ansible because it has many optional features which users need to
6f8f29
# install libraries on their own to use.  For instance, paramiko for the
6f8f29
# network connection plugins or winrm to talk to windows hosts.
6f8f29
# Set this to nil to remove -s
6f8f29
%define py_shbang_opts %{nil}
6f8f29
%define py2_shbang_opts %{nil}
6f8f29
%define py3_shbang_opts %{nil}
6f8f29
0fdcc6
%define vendor_path %{buildroot}%{python3_sitelib}/ansible/_vendor/
0fdcc6
%define vendor_pip %{__python3} -m pip install --no-deps -v --no-build-isolation --no-binary :all: -t %{vendor_path}
6f8f29
6f8f29
# These control which bundled dep versions we pin against
b23843
%global jinja2_version 3.1.2
b23843
%global markupsafe_version 2.1.0
6f8f29
%global packaging_version 20.4
6f8f29
%global pyparsing_version 2.4.7
b23843
%global resolvelib_version 0.5.4
6f8f29
6f8f29
6f8f29
Name: ansible-core
6f8f29
Summary: SSH-based configuration management, deployment, and task execution system
522bc8
Version: 2.14.2
0fdcc6
Release: 3%{?dist}
6f8f29
ExcludeArch: i686
6f8f29
6f8f29
Group: Development/Libraries
6f8f29
License: GPLv3+
0fdcc6
Source0: https://files.pythonhosted.org/packages/source/a/ansible-core/ansible-core-%{version}.tar.gz
6f8f29
Source1: ansible-test-data-files.txt
6f8f29
6f8f29
# And bundled deps
0fdcc6
Source2: https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-%{jinja2_version}.tar.gz
0fdcc6
Source3: https://files.pythonhosted.org/packages/source/M/MarkupSafe/MarkupSafe-%{markupsafe_version}.tar.gz
0fdcc6
Source4: https://files.pythonhosted.org/packages/source/p/packaging/packaging-%{packaging_version}.tar.gz
0fdcc6
Source5: https://files.pythonhosted.org/packages/source/p/pyparsing/pyparsing-%{pyparsing_version}.tar.gz
0fdcc6
Source6: https://files.pythonhosted.org/packages/source/r/resolvelib/resolvelib-%{resolvelib_version}.tar.gz
6f8f29
0fdcc6
Patch0: remove-bundled-deps-from-requirements.patch
6f8f29
6f8f29
URL: http://ansible.com
6f8f29
39aad6
# We conflict old ansible, and any version of ansible-base.
39aad6
Conflicts: ansible < 2.10.0
39aad6
Conflicts: ansible-base
6f8f29
6f8f29
# ... and provide 'ansible' so that old packages still work without updated
6f8f29
# spec files.
154d82
# Provides: ansible
6f8f29
6f8f29
# Bundled provides that are sprinkled throughout the codebase.
6f8f29
Provides: bundled(python-backports-ssl_match_hostname) = 3.7.0.1
b23843
Provides: bundled(python-distro) = 1.6.0
6f8f29
Provides: bundled(python-selectors2) = 1.1.1
b23843
Provides: bundled(python-six) = 1.16.0
6f8f29
6f8f29
# Things we explicitly bundle via src rpm, and put in ansible._vendor
b23843
Provides: bundled(python-jinja2) = %{jinja2_version}
b23843
Provides: bundled(python-markupsafe) = %{markupsafe_version}
6f8f29
Provides: bundled(python-packaging) = %{packaging_version}
6f8f29
Provides: bundled(python-pyparsing) = %{pyparsing_version}
b23843
Provides: bundled(python-resolvelib) = %{resolvelib_version}
0fdcc6
0fdcc6
BuildRequires: python%{python3_pkgversion}-devel
0fdcc6
BuildRequires: python%{python3_pkgversion}-pip
0fdcc6
BuildRequires: python%{python3_pkgversion}-pyyaml
0fdcc6
BuildRequires: python%{python3_pkgversion}-rpm-macros
0fdcc6
BuildRequires: python%{python3_pkgversion}-setuptools
0fdcc6
BuildRequires: python%{python3_pkgversion}-wheel
b23843
BuildRequires: make git-core gcc
6f8f29
06892c
Requires: git-core
0fdcc6
Requires: python%{python3_pkgversion}-PyYAML >= 5.1
0fdcc6
Requires: python%{python3_pkgversion}-cryptography
0fdcc6
Requires: python%{python3_pkgversion}-six
6f8f29
Requires: sshpass
6f8f29
6f8f29
%description
6f8f29
Ansible is a radically simple model-driven configuration management,
6f8f29
multi-node deployment, and remote task execution system. Ansible works
6f8f29
over SSH and does not require any software or daemons to be installed
6f8f29
on remote nodes. Extension modules can be written in any language and
6f8f29
are transferred to managed machines automatically.
6f8f29
6f8f29
%package -n ansible-test
6f8f29
Summary: Tool for testing ansible plugin and module code
6f8f29
Requires: %{name} = %{version}-%{release}
6f8f29
6f8f29
%description -n ansible-test
6f8f29
Ansible is a radically simple model-driven configuration management,
6f8f29
multi-node deployment, and remote task execution system. Ansible works
6f8f29
over SSH and does not require any software or daemons to be installed
6f8f29
on remote nodes. Extension modules can be written in any language and
6f8f29
are transferred to managed machines automatically.
6f8f29
6f8f29
This package installs the ansible-test command for testing modules and plugins
6f8f29
developed for ansible.
6f8f29
6f8f29
%prep
0fdcc6
%setup -q -b2 -b3 -b4 -b5 -b6 -n ansible-core-%{version}
0fdcc6
%patch0 -p1
6f8f29
6f8f29
# Fix all Python shebangs recursively in ansible-test
0fdcc6
%{py3_shebang_fix} test/lib/ansible_test
6f8f29
6f8f29
%build
0fdcc6
%{py3_build}
6f8f29
6f8f29
%install
0fdcc6
%{py3_install}
6f8f29
6f8f29
# Handle bundled deps:
6f8f29
%{vendor_pip} \
0fdcc6
  ../Jinja2-%{jinja2_version}/ \
0fdcc6
  ../MarkupSafe-%{markupsafe_version}/ \
0fdcc6
  ../packaging-%{packaging_version}/ \
0fdcc6
  ../pyparsing-%{pyparsing_version}/ \
0fdcc6
  ../resolvelib-%{resolvelib_version}
6f8f29
6f8f29
# Create system directories that Ansible defines as default locations in
6f8f29
# ansible/config/base.yml
6f8f29
DATADIR_LOCATIONS='%{_datadir}/ansible/collections
6f8f29
%{_datadir}/ansible/plugins/doc_fragments
6f8f29
%{_datadir}/ansible/plugins/action
6f8f29
%{_datadir}/ansible/plugins/become
6f8f29
%{_datadir}/ansible/plugins/cache
6f8f29
%{_datadir}/ansible/plugins/callback
6f8f29
%{_datadir}/ansible/plugins/cliconf
6f8f29
%{_datadir}/ansible/plugins/connection
6f8f29
%{_datadir}/ansible/plugins/filter
6f8f29
%{_datadir}/ansible/plugins/httpapi
6f8f29
%{_datadir}/ansible/plugins/inventory
6f8f29
%{_datadir}/ansible/plugins/lookup
6f8f29
%{_datadir}/ansible/plugins/modules
6f8f29
%{_datadir}/ansible/plugins/module_utils
6f8f29
%{_datadir}/ansible/plugins/netconf
6f8f29
%{_datadir}/ansible/roles
6f8f29
%{_datadir}/ansible/plugins/strategy
6f8f29
%{_datadir}/ansible/plugins/terminal
6f8f29
%{_datadir}/ansible/plugins/test
6f8f29
%{_datadir}/ansible/plugins/vars'
6f8f29
6f8f29
UPSTREAM_DATADIR_LOCATIONS=$(grep -ri default lib/ansible/config/base.yml | tr ':' '\n' | grep '/usr/share/ansible')
6f8f29
6f8f29
if [ "$SYSTEM_LOCATIONS" != "$UPSTREAM_SYSTEM_LOCATIONS" ] ; then
6f8f29
	echo "The upstream Ansible datadir locations have changed.  Spec file needs to be updated"
6f8f29
	exit 1
6f8f29
fi
6f8f29
6f8f29
mkdir -p %{buildroot}%{_datadir}/ansible/plugins/
6f8f29
for location in $DATADIR_LOCATIONS ; do
6f8f29
	mkdir %{buildroot}"$location"
6f8f29
done
6f8f29
mkdir -p %{buildroot}%{_sysconfdir}/ansible/
6f8f29
mkdir -p %{buildroot}%{_sysconfdir}/ansible/roles/
6f8f29
6f8f29
cp examples/hosts %{buildroot}%{_sysconfdir}/ansible/
6f8f29
cp examples/ansible.cfg %{buildroot}%{_sysconfdir}/ansible/
6f8f29
mkdir -p %{buildroot}/%{_mandir}/man1/
b5d1d1
b5d1d1
cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/
b5d1d1
b5d1d1
cp -pr docs/docsite/rst .
6f8f29
cp -p lib/ansible_core.egg-info/PKG-INFO .
6f8f29
522bc8
strip --strip-unneeded %{vendor_path}/markupsafe/_speedups%{python3_ext_suffix}
522bc8
6f8f29
%files
6f8f29
%defattr(-,root,root)
6f8f29
%{_bindir}/ansible*
6f8f29
%exclude %{_bindir}/ansible-test
6f8f29
%config(noreplace) %{_sysconfdir}/ansible/
6f8f29
%doc README.rst PKG-INFO COPYING
e4b412
%doc changelogs/CHANGELOG-v2.*.rst
b5d1d1
%doc %{_mandir}/man1/ansible*
6f8f29
%{_datadir}/ansible/
0fdcc6
%{python3_sitelib}/ansible*
0fdcc6
%exclude %{python3_sitelib}/ansible_test
0fdcc6
%exclude %{python3_sitelib}/ansible/_vendor/markupsafe/_speedups.c
6f8f29
6f8f29
%files -n ansible-test
6f8f29
%{_bindir}/ansible-test
0fdcc6
%{python3_sitelib}/ansible_test
6f8f29
6f8f29
%changelog
0fdcc6
* Tue Feb 14 2023 Dimitri Savineau <dsavinea@redhat.com> - 2.14.2-3
0fdcc6
- rebuild with python 3.11 (rhbz#2169524)
0fdcc6
- remove bundled dependencies from requirements file (rhbz#2143974)
0fdcc6
- use PyPi sources (rhbz#2160277)
0fdcc6
- remove straightplugin
0fdcc6
522bc8
* Thu Feb 02 2023 Christian Adams <chadams@redhat.com> - 2.14.2-2
522bc8
- fix debuginfo symbols from markupsafe dependency (rhbz#2166414)
522bc8
522bc8
* Wed Feb 01 2023 Christian Adams <chadams@redhat.com> - 2.14.2-1
522bc8
- ansible-core 2.14.2 release (rhbz#2166414)
522bc8
2b4d40
* Wed Dec 07 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.14.1-1
2b4d40
- ansible-core 2.14.1 release (rhbz#2151594)
2b4d40
4a4918
* Tue Nov 08 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.14.0-1
4a4918
- ansible-core 2.14.0 release (rhbz#2141386)
4a4918
210bed
* Mon Nov 07 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.6-1
210bed
- ansible-core 2.13.6 release (rhbz#2141109)
210bed
- fix service_facts module parsing (rhbz#2141111)
210bed
f929fe
* Wed Oct 12 2022 James Marshall <jamarsha@redhat.com> - 2.13.5-1
f929fe
- ansible-core 2.13.5 release (rhbz#2134116)
f929fe
f929fe
* Fri Oct 07 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.4-1
f929fe
- ansible-core 2.13.4 release (rhbz#2133024)
f929fe
f929fe
* Mon Aug 15 2022 James Marshall <jamarsha@redhat.com> - 2.13.3-1
67644e
- ansible-core 2.13.3 release (rhbz#2118475)
67644e
48a2e2
* Wed Jul 20 2022 James Marshall <jamarsha@redhat.com> - 2.13.2-1
48a2e2
- ansible-core 2.13.2 release (rhbz#2109192)
48a2e2
b23843
* Mon Jul 04 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.13.1-1
b23843
- ansible-core 2.13.1 release (rhbz#2103699)
b23843
- add bundled version of jinja2, markupsafe and resolvelib
b23843
- rebuild with python 3.9
b23843
5bbd1b
* Mon Jun 20 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.7-1
5bbd1b
- ansible-core 2.12.7 release (rhbz#2099323)
5bbd1b
b5d1d1
* Thu Jun 09 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.6-3
b5d1d1
- Build manpages (rhbz#2032809)
b5d1d1
- Remove legacy files
b5d1d1
06892c
* Tue Jun 07 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.6-2
06892c
- switch from git to git-core dependency (rhbz#2094549)
06892c
660e21
* Tue May 24 2022 James Marshall <jamarsha@redhat.com> - 2.12.6-1
660e21
- ansible-core 2.12.6 release
660e21
5c1d7e
* Mon May 09 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.5-1
5c1d7e
- ansible-core 2.12.5 release
5c1d7e
803e38
* Mon Apr 11 2022 James Marshall <jamarsha@redhat.com> - 2.12.4-1
803e38
- ansible-core 2.12.4 release
803e38
e4b412
* Mon Mar 14 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.3-1
e4b412
- ansible-core 2.12.3 release
e4b412
- re-enable changelog and manpages
e4b412
39aad6
* Mon Mar 07 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.2-3
39aad6
- replace Obsolete to Conflicts
39aad6
823d32
* Wed Feb 02 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.2-2
823d32
- fix ansible tarball setup
823d32
823d32
* Wed Feb 02 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.2-1
823d32
- ansible-core 2.12.2 release
823d32
- add gating and test files
823d32
154d82
* Wed Jan 19 2022 Dimitri Savineau <dsavinea@redhat.com> - 2.12.1-2
154d82
- Remove Provides on ansible
154d82
6f8f29
* Thu Dec 16 2021 Yanis Guenane <yguenane@redhat.com> - 2.12.1-1
6f8f29
- ansible-core 2.12.1-1
6f8f29
6f8f29
* Wed Jul 21 2021 Paul Belanger <pabelanger@redhat.com> - 2.11.3-2
6f8f29
- Add git dependency for ansible-galaxy CLI command.
6f8f29
6f8f29
* Tue Jul 20 2021 Yanis Guenane <yguenane@redhat.com> - 2.11.3-1
6f8f29
- ansible-core 2.11.3-1
6f8f29
6f8f29
* Fri Jul 02 2021 Satoe Imaishi <simaishi@redhat.com> - 2.11.2-2
6f8f29
- Add man pages
6f8f29
6f8f29
* Tue Jun 29 2021 Paul Belanger <pabelanger@redhat.com> - 2.11.2-1
6f8f29
- ansible-core 2.11.2 released.
6f8f29
- Drop bundled version of resolvelib in favor of
6f8f29
  python38-resolvelib.
6f8f29
6f8f29
* Wed Mar 31 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b4-1
6f8f29
- ansible-core 2.11.0 beta 4
6f8f29
6f8f29
* Thu Mar 18 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b2-3
6f8f29
- Try adding a Provides for old ansible.
6f8f29
6f8f29
* Thu Mar 18 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b2-2
6f8f29
- Try Obsoletes instead of Conflicts.
6f8f29
6f8f29
* Thu Mar 18 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b2-1
6f8f29
- ansible-core 2.11.0 beta 2
6f8f29
- Conflict with old ansible and ansible-base.
6f8f29
6f8f29
* Thu Mar 11 2021 Rick Elrod <relrod@redhat.com> - 2.11.0b1-1
6f8f29
- ansible-core 2.11.0 beta 1
6f8f29
6f8f29
* Mon Nov 30 2020 Rick Elrod <relrod@redhat.com> - 2.11.0-1
6f8f29
- ansible-core, beta
6f8f29
6f8f29
* Wed Jun 10 2020 Rick Elrod <relrod@redhat.com> - 2.10.0-1
6f8f29
- ansible-base, beta