Blame SPECS/rhc-worker-playbook.spec

e79184
%define debug_package %{nil}
995bdb
%define community_general_version 4.4.0
995bdb
%define ansible_posix_version 1.3.0
e79184
a15b07
Name:       rhc-worker-playbook
a15b07
Summary:    Red Hat connect worker for launching Ansible Runner
995bdb
Version:    0.1.8
816461
Release:    4%{?dist}
a15b07
License:    GPLv2+
995bdb
Source:     rhc-worker-playbook-0.1.8.tar.gz
995bdb
Source1:    https://github.com/ansible-collections/community.general/archive/%{community_general_version}/ansible-collection-community-general-%{community_general_version}.tar.gz
995bdb
Source2:    https://github.com/ansible-collections/ansible.posix/archive/%{ansible_posix_version}/ansible-collection-ansible-posix-%{ansible_posix_version}.tar.gz
995bdb
816461
#
816461
# patches_ignore=DROP-IN-RPM
816461
# patches_base=8ddc5ccfc97290a021b4c4de673b92fedc38cbfb
816461
Patch0001: 0001-fix-Execute-playbook-asynchronously.patch
816461
Patch0002: 0002-Do-not-busy-wait-when-playbook-is-running.patch
816461
Patch0003: 0003-Use-thread.join-timeout-to-avoid-busy-waiting-and-si.patch
e79184
e79184
ExclusiveArch: %{go_arches}
a15b07
a15b07
%{?__python3:Requires: %{__python3}}
e79184
Requires: insights-client
e79184
Requires: python3dist(requests)
995bdb
Requires: ansible-core
e79184
BuildRequires: rhc
e79184
BuildRequires: pkgconfig
a15b07
BuildRequires: python3-devel
e79184
BuildRequires: python3dist(pip)
e79184
BuildRequires: python3dist(wheel)
a15b07
BuildRequires: openssl-devel
a15b07
BuildRequires: c-ares-devel
a15b07
BuildRequires: zlib-devel
a15b07
BuildRequires: python3dist(cython)
a15b07
a15b07
%description
a15b07
Python-based worker for Red Hat connect, used to launch Ansible playbooks via Ansible Runner.
a15b07
a15b07
%prep
995bdb
%setup -q -a1 -a2 -n %{name}-%{version}
816461
995bdb
%patch0001 -p1
816461
%patch0002 -p1
816461
%patch0003 -p1
816461
995bdb
pushd community.general-%{community_general_version}
995bdb
rm -vr .github .azure-pipelines
995bdb
rm -rvf tests/
995bdb
find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' +
995bdb
find -type f -name '.gitignore' -print -delete
995bdb
popd
995bdb
995bdb
pushd ansible.posix-%{ansible_posix_version}
995bdb
rm -vr tests/{integration,utils} .github changelogs/fragments/.keep {test-,}requirements.txt shippable.yml
995bdb
rm -vr .azure-pipelines
995bdb
rm -rvf tests/
995bdb
find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' +
995bdb
find -type f -name '.gitignore' -print -delete
995bdb
popd
a15b07
e79184
%build
a15b07
export GRPC_PYTHON_BUILD_WITH_CYTHON=True
a15b07
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True
a15b07
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True
a15b07
export GRPC_PYTHON_BUILD_SYSTEM_CARES=True
a15b07
export GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=True
e79184
%define rhc_config_dir $(pkg-config rhc --variable workerconfdir)
a15b07
ab0ac9
%{__make} PREFIX=%{_prefix} LIBDIR=%{_libdir} PYTHON_PKGDIR=%{python3_sitelib} CONFIG_DIR=%{rhc_config_dir} installed-lib-dir
e79184
%{make_build} build
a15b07
995bdb
# Building the Ansible Collections
995bdb
pushd community.general-%{community_general_version}
995bdb
tar -cf %{_tmppath}/community-general-%{community_general_version}.tar.gz .
995bdb
popd
995bdb
995bdb
pushd ansible.posix-%{ansible_posix_version}
995bdb
tar -cf %{_tmppath}/ansible-posix-%{ansible_posix_version}.tar.gz .
995bdb
popd
995bdb
e79184
%install
ab0ac9
%{make_install} PREFIX=%{_prefix} LIBDIR=%{_libdir} CONFIG_DIR=%{rhc_config_dir} PYTHON_PKGDIR=%{python3_sitelib}
a15b07
995bdb
# Installing the Ansible Collections
995bdb
mkdir -p %{buildroot}%{_datadir}/rhc-worker-playbook/ansible/collections/ansible_collections/community/general
995bdb
mkdir -p %{buildroot}%{_datadir}/rhc-worker-playbook/ansible/collections/ansible_collections/ansible/posix
995bdb
995bdb
pushd %{buildroot}%{_datadir}/rhc-worker-playbook/ansible/collections/ansible_collections/community/general
995bdb
tar -xf %{_tmppath}/community-general-%{community_general_version}.tar.gz
995bdb
popd
995bdb
995bdb
pushd %{buildroot}%{_datadir}/rhc-worker-playbook/ansible/collections/ansible_collections/ansible/posix
995bdb
tar -xf %{_tmppath}/ansible-posix-%{ansible_posix_version}.tar.gz
995bdb
popd
995bdb
995bdb
# Creating the logs directory for ansible-runner
995bdb
mkdir -p %{buildroot}%{_localstatedir}/log/rhc-worker-playbook/ansible
995bdb
a15b07
%files
a15b07
%{_libexecdir}/rhc/rhc-worker-playbook.worker
a15b07
%{python3_sitelib}/rhc_worker_playbook/
a15b07
%{python3_sitelib}/rhc_worker_playbook*.egg-info/
a15b07
%{_libdir}/rhc-worker-playbook/
995bdb
%{_datadir}/rhc-worker-playbook/ansible/collections/ansible_collections/
995bdb
%{_localstatedir}/log/rhc-worker-playbook/ansible/
e79184
%config %{_sysconfdir}/rhc/workers/rhc-worker-playbook.toml
995bdb
%exclude %{_libdir}/.build-id/
a15b07
a15b07
%doc
a15b07
a15b07
%changelog
816461
* Sat Oct 22 2022 Gael Chamoulaud <gchamoul@redhat.com> 0.1.8-4
816461
- Use thread.join(timeout) to avoid busy waiting and simplify interval event posting logic (rhbz#2137005)
816461
816461
* Fri Aug 05 2022 Gael Chamoulaud <gchamoul@redhat.com> 0.1.8-3
816461
- Do not busy-wait when playbook is running (rhbz#2104199)
816461
816461
* Mon Mar 14 2022 Gaël Chamoulaud <gchamoul@redhat.com> - 0.1.8-2
816461
- Update patches
816461
- Add DROP-IN-RPM patches_ignore rule for rdopkg
816461
995bdb
* Mon Feb 21 2022 Gaël Chamoulaud <gchamoul@redhat.com> - 0.1.8-1
995bdb
- Patch to fix Execute Playbook Asynchronously (RHBZ#2020426)
995bdb
995bdb
* Thu Feb 03 2022 Gaël Chamoulaud <gchamoul@redhat.com> - 0.1.8-0
995bdb
- Fix: Bump ansible-runner to 2.1.1 and dependencies in vendor (RHBZ#2053207)
995bdb
- Upload new rhc-worker-playbook-0.1.8.tar.gz source
995bdb
995bdb
* Thu Feb 03 2022 Gaël Chamoulaud <gchamoul@redhat.com> - 0.1.7-0
995bdb
- Add Ansible community general and ansible.posix Collections
995bdb
- Upload new rhc-worker-playbook-0.1.7.tar.gz source
995bdb
ab0ac9
* Mon Apr 19 2021 Jeremy Crafts <jcrafts@redhat.com> - 0.1.5-1
ab0ac9
- Changes to playbook validation logic
ab0ac9
- Enhancements for logging to rhcd
ab0ac9
- Fix for subprocess environment
ab0ac9
e79184
* Thu Mar 25 2021 Jeremy Crafts <jcrafts@redhat.com> - 0.1.4-1
e79184
- Enhancements to playbook validation
e79184
- Fixes for regular execution status updates
e79184
- Configuration fixes