Blame SPECS/ansible-pcp.spec

2e903c
Name:             ansible-pcp
2546c9
Version:          2.2.7
bd4a51
Release:          1%{?dist}
2e903c
Summary:          Ansible Metric collection for Performance Co-Pilot
2e903c
License:          MIT
2e903c
URL:              https://github.com/performancecopilot/ansible-pcp
2e903c
Source:           https://github.com/performancecopilot/ansible-pcp/archive/v%{version}/%{name}-%{version}.tar.gz
2e903c
BuildArch:        noarch
2e903c
2e903c
%if 0%{?rhel}
2e903c
%global collection_namespace redhat
2e903c
%global collection_name rhel_metrics
2e903c
%else
2e903c
%global collection_namespace performancecopilot
2e903c
%global collection_name metrics
2e903c
%endif
2e903c
2e903c
# NOTE: Even though ansible-core is in 8.6, it is only available
2e903c
# at *runtime*, not at *buildtime* - so we can't have
bd4a51
# ansible-core as a build_dep on latest RHEL versions.
bd4a51
%if 0%{?fedora}
bd4a51
%bcond_without ansible
2e903c
%global ansible_build_dep ansible-core >= 2.11.0
2e903c
%else
2e903c
%if 0%{?rhel} && ! 0%{?epel}
bd4a51
%bcond_with ansible
2e903c
%else
bd4a51
%bcond_without ansible
2e903c
%global ansible_build_dep ansible >= 2.9.10
2e903c
%endif
2e903c
%endif
2e903c
bd4a51
%if 0%{?rhel} >= 8
bd4a51
Requires: (ansible-core >= 2.11.0 or ansible >= 2.9.0)
bd4a51
%endif
bd4a51
bd4a51
%if %{with ansible}
2e903c
BuildRequires:    %{ansible_build_dep}
2e903c
%endif
bd4a51
bd4a51
%{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/}
bd4a51
bd4a51
# package has been removed from RHEL8
bd4a51
%if 0%{?rhel} >= 8
bd4a51
%bcond_with ansible_lint
2e903c
%else
bd4a51
%bcond_without ansible_lint
2e903c
%endif
2e903c
bd4a51
%if %{with ansible_lint}
2e903c
BuildRequires:    python3-ansible-lint
2e903c
%endif
2e903c
2e903c
%description
2e903c
A collection containing roles for Performance Co-Pilot (PCP) and related
2e903c
software such as Redis and Grafana.  The collection is made up of several
2e903c
Ansible roles, including:
2e903c
2e903c
%{collection_namespace}.%{collection_name}.pcp
2e903c
A role for core PCP capabilities, configuring live performance analysis
2e903c
with a large base set of metrics from the kernel and system services, as
2e903c
well as data recording and rule inference.
2e903c
2e903c
%{collection_namespace}.%{collection_name}.redis
2e903c
A role for configuring a local Redis server, suitable for use with a
2e903c
Performance Co-Pilot archive repository (for single or many hosts) and
2e903c
fast, scalable querying of metrics.
2e903c
2e903c
%{collection_namespace}.%{collection_name}.grafana
2e903c
A role for configuring a local Grafana server, providing web frontend
2e903c
visuals for Performance Co-Pilot metrics, both live and historically.
2e903c
Data sources for Vector (live), Redis (historical) and interactive
2e903c
bpftrace (eBPF) scripts can be configured by this role.  The PCP REST
2e903c
API service (from the core pcp role) should be configured in order to
2e903c
use this role.
2e903c
2e903c
%{collection_namespace}.%{collection_name}.bpftrace
2e903c
A role that extends the core PCP role, providing metrics from bpftrace
2e903c
scripts using Linux eBPF facilities.  Configuring authentication of a
2e903c
local user capable of running bpftrace scripts via the PCP agent is a
2e903c
key task of this role.
2e903c
2e903c
%{collection_namespace}.%{collection_name}.elasticsearch
2e903c
A role that extends the core PCP role, providing metrics from a live
2e903c
ElasticSearch instance for PCP analysis or exporting of PCP metric
2e903c
values (and metadata) to ElasticSearch for the indexing and querying
2e903c
of performance data.
2e903c
2e903c
%prep
2e903c
%autosetup
2e903c
mv .yamllint.yml yamllint.yml
2e903c
mv .yamllint_defaults.yml yamllint_defaults.yml
2e903c
%if 0%{?rhel}
2e903c
rm -vr roles/repository tests/*repository* tests/*/*repository* docs/repository
2e903c
%endif
2e903c
rm -vr .github .gitignore .ansible-lint .*.yml
2e903c
sed -i \
2e903c
    -e 's/^name: .*/name: %{collection_name}/g' \
2e903c
    -e 's/^namespace: .*/namespace: %{collection_namespace}/g' \
2e903c
    galaxy.yml
2e903c
find . -name \*.yml -o -name \*.md | while read file; do
2e903c
    sed -i \
2e903c
        -e 's/performancecopilot.metrics/%{collection_namespace}.%{collection_name}/g' \
2e903c
    $file
2e903c
done
2e903c
2e903c
%build
bd4a51
%if %{with ansible}
2e903c
%ansible_collection_build
2e903c
%else
2e903c
tar -cf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz .
2e903c
%endif
2e903c
2e903c
%install
bd4a51
%if %{with ansible}
2e903c
%ansible_collection_install
2e903c
%else
2e903c
mkdir -p %{buildroot}%{ansible_collection_files}/%{collection_name}
2e903c
cd %{buildroot}%{ansible_collection_files}/%{collection_name}
2e903c
tar -xf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz
2e903c
%endif
2e903c
2e903c
%check
2e903c
mv yamllint.yml .yamllint.yml
2e903c
mv yamllint_defaults.yml .yamllint_defaults.yml
bd4a51
%if %{with ansible_lint}
2e903c
ansible-lint `find roles -name \*.yml`
2e903c
%endif
2e903c
2e903c
%files
2e903c
%doc README.md
2e903c
%license LICENSE
2e903c
%{ansible_collection_files}
2e903c
2e903c
%changelog
2546c9
* Fri Oct 28 2022 Nathan Scott <nathans@redhat.com> 2.2.7-1
2546c9
- Latest upstream release (BZ 2132847)
2546c9
bd4a51
* Thu Apr 21 2022 Nathan Scott <nathans@redhat.com> 2.2.5-1
bd4a51
- Switch to using bcond spec file mechanisms
bd4a51
- Latest upstream release (BZ 2059464)
bd4a51
2e903c
* Tue Feb 15 2022 Nathan Scott <nathans@redhat.com> 2.2.2-2
2e903c
- RHEL8.6+, RHEL9+, Fedora - add "ansible-core or ansible" dep
2e903c
2e903c
* Fri Nov 12 2021 Nathan Scott <nathans@redhat.com> 2.2.2-1
2e903c
- Resolves Grafana provisioning issue (BZ 1967321)
2e903c
- Latest upstream release (BZ 2022168)
2e903c
2e903c
* Thu Aug 26 2021 Nathan Scott <nathans@redhat.com> 2.2.1-1
2e903c
- Latest upstream release
2e903c
2e903c
* Fri Jun 25 2021 Nathan Scott <nathans@redhat.com> 2.1.4-1
2e903c
- Latest upstream release
2e903c
2e903c
* Tue Jun 08 2021 Nathan Scott <nathans@redhat.com> 2.1.3-3
2e903c
- Rebuild for full pass through CI/gating processes
2e903c
2e903c
* Mon Jun 07 2021 Nathan Scott <nathans@redhat.com> 2.1.3-2
2e903c
- Drop unnecessary package dependency on Ansible
2e903c
2e903c
* Thu Jun 03 2021 Nathan Scott <nathans@redhat.com> 2.1.3-1
2e903c
- Initial version of RHEL package (BZ 1854055)
2e903c
- Latest upstream release
2e903c
2e903c
* Fri Feb 05 2021 Nathan Scott <nathans@redhat.com> 2.1.2-1
2e903c
- Add RHEL macros to the spec alongside Fedora
2e903c
- Latest upstream release
2e903c
2e903c
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-2
2e903c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
2e903c
2e903c
* Wed Nov 11 2020 Nathan Scott <nathans@redhat.com> 2.0.3-1
2e903c
- Updated for new version with changed namespace
2e903c
- Ansible collection macros now used in the spec
2e903c
- Added ansible-lint checking in %%check section
2e903c
2e903c
* Fri Oct 23 2020 Nathan Scott <nathans@redhat.com> 1.0.0-1
2e903c
- Initial RPM spec build