Blame SPECS/rhc-worker-playbook.spec

6981de
%define debug_package %{nil}
a3da4f
%define community_general_version 4.4.0
a3da4f
%define ansible_posix_version 1.3.0
6981de
6981de
Name:       rhc-worker-playbook
a3da4f
Version:    0.1.8
9e5510
Release:    4%{?dist}
6981de
Summary:    Python worker for Red Hat connector that launches Ansible Runner
6981de
License:    GPLv2+
6981de
URL:        https://github.com/redhatinsights/rhc-worker-playbook
a3da4f
Source:     rhc-worker-playbook-0.1.8.tar.gz
a3da4f
Source1:    https://github.com/ansible-collections/community.general/archive/%{community_general_version}/ansible-collection-community-general-%{community_general_version}.tar.gz
a3da4f
Source2:    https://github.com/ansible-collections/ansible.posix/archive/%{ansible_posix_version}/ansible-collection-ansible-posix-%{ansible_posix_version}.tar.gz
a3da4f
9e5510
#
9e5510
# patches_ignore=DROP-IN-RPM
9e5510
# patches_base=8ddc5ccfc97290a021b4c4de673b92fedc38cbfb
9e5510
Patch0001: 0001-fix-Execute-playbook-asynchronously.patch
9e5510
Patch0002: 0002-Do-not-busy-wait-when-playbook-is-running.patch
9e5510
Patch0003: 0003-Use-thread.join-timeout-to-avoid-busy-waiting-and-si.patch
6981de
6981de
%{?__python3:Requires: %{__python3}}
6981de
Requires: insights-client
6981de
Requires: python3dist(requests)
6981de
Requires: python3dist(pyyaml)
a3da4f
Requires: ansible-core
6981de
BuildRequires: rhc
6981de
BuildRequires: pkgconfig
6981de
BuildRequires: python3-devel
6981de
BuildRequires: python3dist(pip)
6981de
BuildRequires: python3dist(wheel)
6981de
BuildRequires: python3dist(setuptools)
6981de
BuildRequires: openssl-devel
6981de
BuildRequires: c-ares-devel
6981de
BuildRequires: zlib-devel
6981de
BuildRequires: python3dist(cython)
6981de
BuildRequires: gcc
6981de
BuildRequires: gcc-c++
6981de
6981de
ExclusiveArch: x86_64 s390x ppc64 ppc64le
6981de
6981de
%description
6981de
Python-based worker for Red Hat connect, used to launch Ansible playbooks via Ansible Runner.
6981de
6981de
%prep
a3da4f
%setup -q -a1 -a2 -n %{name}-%{version}
9e5510
a3da4f
%patch0001 -p1
9e5510
%patch0002 -p1
9e5510
%patch0003 -p1
9e5510
a3da4f
pushd community.general-%{community_general_version}
a3da4f
rm -vr .github .azure-pipelines
a3da4f
rm -rvf tests/ hacking/
a3da4f
find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' +
a3da4f
find -type f -name '.gitignore' -print -delete
a3da4f
popd
a3da4f
a3da4f
pushd ansible.posix-%{ansible_posix_version}
a3da4f
rm -vr tests/{integration,utils} .github changelogs/fragments/.keep {test-,}requirements.txt shippable.yml
a3da4f
rm -vr .azure-pipelines
a3da4f
rm -rvf tests/
a3da4f
find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' +
a3da4f
find -type f -name '.gitignore' -print -delete
a3da4f
popd
6981de
6981de
%build
6981de
export GRPC_PYTHON_BUILD_WITH_CYTHON=True
6981de
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True
6981de
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True
6981de
export GRPC_PYTHON_BUILD_SYSTEM_CARES=True
6981de
export GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=True
a3da4f
# TODO(gchamoul): Remove workaround
a3da4f
#  once https://bugzilla.redhat.com/show_bug.cgi?id=2056959 is fixed
a3da4f
#%define rhc_config_dir $(pkg-config rhc --variable workerconfdir)
a3da4f
%define rhc_config_dir /etc/rhc/workers
6981de
6981de
%define _lto_cflags %{nil}
6981de
%set_build_flags
6981de
%{__make} PREFIX=%{_prefix} LIBDIR=%{_libdir} CONFIG_DIR=%{rhc_config_dir} PYTHON_PKGDIR=%{python3_sitelib} installed-lib-dir
6981de
%{make_build} build
6981de
a3da4f
# Building the Ansible Collections
a3da4f
pushd community.general-%{community_general_version}
a3da4f
tar -cf %{_tmppath}/community-general-%{community_general_version}.tar.gz .
a3da4f
popd
a3da4f
a3da4f
pushd ansible.posix-%{ansible_posix_version}
a3da4f
tar -cf %{_tmppath}/ansible-posix-%{ansible_posix_version}.tar.gz .
a3da4f
popd
a3da4f
6981de
%install
6981de
%{make_install} PREFIX=%{_prefix} LIBDIR=%{_libdir} CONFIG_DIR=%{rhc_config_dir} PYTHON_PKGDIR=%{python3_sitelib}
6981de
a3da4f
# Installing the Ansible Collections
a3da4f
mkdir -p %{buildroot}%{_datadir}/rhc-worker-playbook/ansible/collections/ansible_collections/community/general
a3da4f
mkdir -p %{buildroot}%{_datadir}/rhc-worker-playbook/ansible/collections/ansible_collections/ansible/posix
a3da4f
a3da4f
pushd %{buildroot}%{_datadir}/rhc-worker-playbook/ansible/collections/ansible_collections/community/general
a3da4f
tar -xf %{_tmppath}/community-general-%{community_general_version}.tar.gz
a3da4f
popd
a3da4f
a3da4f
pushd %{buildroot}%{_datadir}/rhc-worker-playbook/ansible/collections/ansible_collections/ansible/posix
a3da4f
tar -xf %{_tmppath}/ansible-posix-%{ansible_posix_version}.tar.gz
a3da4f
popd
a3da4f
a3da4f
# Creating the logs directory for ansible-runner
a3da4f
mkdir -p %{buildroot}%{_localstatedir}/log/rhc-worker-playbook/ansible/
a3da4f
a3da4f
6981de
%files
6981de
%{_libexecdir}/rhc/rhc-worker-playbook.worker
6981de
%{python3_sitelib}/rhc_worker_playbook/
6981de
%{python3_sitelib}/rhc_worker_playbook*.egg-info/
6981de
%{_libdir}/rhc-worker-playbook/
a3da4f
%{_datadir}/rhc-worker-playbook/ansible/collections/ansible_collections/
a3da4f
%{_localstatedir}/log/rhc-worker-playbook/ansible/
a3da4f
%config(noreplace) %{_sysconfdir}/rhc/workers/rhc-worker-playbook.toml
6981de
6981de
%doc
6981de
6981de
%changelog
9e5510
* Thu Oct 20 2022 Gael Chamoulaud <gchamoul@redhat.com> 0.1.8-4
9e5510
- Use thread.join(timeout) to avoid busy waiting and simplify interval event posting logic (rhbz#2115848)
9e5510
9e5510
* Fri Aug 05 2022 Gael Chamoulaud <gchamoul@redhat.com> 0.1.8-3
9e5510
- Do not busy-wait when playbook is running (rhbz#2115848)
9e5510
9e5510
* Mon Mar 14 2022 Gaël Chamoulaud <gchamoul@redhat.com> - 0.1.8-2
9e5510
- Add DROP-IN-RPM patches_ignore rule for rdopkg
9e5510
9e5510
* Mon Feb 20 2022 Gaël Chamoulaud <gchamoul@redhat.com> - 0.1.8-1
9e5510
- Patch to fix Execute Playbook Asynchronously (RHBZ#2056861)
a3da4f
9e5510
* Thu Feb 16 2022 Alba Hita <ahitacat@redhat.com> - 0.1.8-0
9e5510
- Fix: Bump ansible-runner to 1.1.1 and dependencies in vendor (RHBZ#2053212)
9e5510
- Upload new rhc-worker-playbook-1.1.8.tar.gz source
a3da4f
a3da4f
* Thu Feb 03 2022 Gaël Chamoulaud <gchamoul@redhat.com> - 0.1.7-0
a3da4f
- Add Ansible community general and ansible.posix Collections
a3da4f
- New Upstream Version
a3da4f
6981de
* Mon Nov  1 2021 Link Dupont <link@redhat.com> - 0.1.6-3
6981de
- Disable LTO due to RHBZ#1893533
6981de
6981de
* Thu Sep 23 2021 Link Dupont <link@redhat.com> - 0.1.6-2
6981de
- Ensure build flags are exported to the build environment
6981de
6981de
* Thu Aug 26 2021 Link Dupont <link@redhat.com> - 0.1.6-1
6981de
- New upstream version
6981de
6981de
* Fri Aug  6 2021 Link Dupont <link@redhat.com> - 0.1.5^0.9ef03b90.wtree.0663ne
6981de
- New upstream version
6981de
6981de
* Mon Apr 19 2021 Jeremy Crafts <jcrafts@redhat.com> - 0.1.5-1
6981de
- Changes to playbook validation logic
6981de
- Enhancements for logging to rhcd
6981de
- Fix for subprocess environment
6981de
6981de
* Thu Mar 25 2021 Jeremy Crafts <jcrafts@redhat.com> - 0.1.4-1
6981de
- Enhancements to playbook validation
6981de
- Fixes for regular execution status updates
6981de
- Configuration fixes