ef63c6
%global project freeipa
ef63c6
%global shortname healthcheck
ef63c6
%global longname ipa%{shortname}
ef63c6
%global debug_package %{nil}
ef63c6
%global python3dir %{_builddir}/python3-%{name}-%{version}-%{release}
ef63c6
%{!?python3_sitelib: %global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
ef63c6
ef63c6
ef63c6
Name:           ipa-healthcheck
b9b3bb
Version:        0.7
7ad35c
Release:        10%{?dist}
ef63c6
Summary:        Health check tool for IdM
ef63c6
BuildArch:      noarch
ef63c6
License:        GPLv3
ef63c6
URL:            https://github.com/%{project}/freeipa-healthcheck
ef63c6
Source0:        https://github.com/%{project}/%{name}/archive/%{version}.tar.gz#/%{project}-%{shortname}-%{version}.tar.gz
ef63c6
Source1:        %{longname}.conf
ef63c6
ef63c6
Patch0001:      0001-Remove-requirement-for-pytest-runner-since-PyPI-isn-.patch
b9b3bb
Patch0002:      0002-Remove-ipaclustercheck.patch
b9b3bb
Patch0003:      0003-Use-trust-find-and-trustdomain-find-to-identify-all-.patch
b9b3bb
Patch0004:      0004-result-names-are-not-translated-when-reading-input-f.patch
cf0866
Patch0005:      0005-Add-check-for-IPA-KRA-Agent.patch
cf0866
Patch0006:      0006-Add-tests-for-KRA-Agent-validation.patch
cf0866
Patch0007:      0007-Return-user-friendly-message-when-no-issues-found.patch
cf0866
Patch0009:      0009-Add-checks-to-detect-mismatch-of-certificates.patch
cf0866
Patch0010:      0010-Add-tests-for-certificate-mismatch-detection.patch
cf0866
Patch0011:      0011-Add-log-files-to-the-set-of-files-checked-for-owner-.patch
cf0866
Patch0012:      0012-Handle-files-that-don-t-exist-in-FileCheck.patch
235f5a
Patch0013:      0013-Add-service-check-dependencies.patch
235f5a
Patch0014:      0014-Filter-out-the-pki-healthcheck-sources-if-IPA-CA-is-.patch
235f5a
Patch0015:      0015-Work-with-existing-resolve_rrsets-and-newer-resolve_.patch
235f5a
Patch0016:      0016-tests-Generate-a-proper-not-valid-after-field.patch
235f5a
Patch0017:      0017-Fix-the-number-of-expected-results-in-the-fix-file-t.patch
7ad35c
Patch0018:      0018-Don-t-collect-the-CRLManager-role-if-the-CA-is-not-c.patch
7ad35c
Patch0019:      0019-Don-t-depend-on-IPA-status-when-suppressing-pki-chec.patch
ef63c6
ef63c6
Requires:       %{name}-core = %{version}-%{release}
ef63c6
Requires:       ipa-server
ef63c6
Requires:       python3-ipalib
ef63c6
Requires:       python3-ipaserver
b9b3bb
Requires:       python3-lib389
ef63c6
# cronie-anacron provides anacron
ef63c6
Requires:       anacron
ef63c6
Requires:       logrotate
ef63c6
Requires(post): systemd-units
ef63c6
Requires:       %{name}-core = %{version}-%{release}
ef63c6
BuildRequires:  python3-devel
ef63c6
BuildRequires:  systemd-devel
ef63c6
%{?systemd_requires}
ef63c6
ef63c6
ef63c6
%description
ef63c6
The FreeIPA health check tool provides a set of checks to
ef63c6
proactively detect defects in a FreeIPA cluster.
ef63c6
ef63c6
%package -n %{name}-core
ef63c6
Summary: Core plugin system for healthcheck
ef63c6
# No Requires on %%{name} = %%{version}-%%{release} since this can be
ef63c6
# installed standalone
ef63c6
Conflicts: %{name} < 0.4
ef63c6
ef63c6
%description -n %{name}-core
ef63c6
Core files
ef63c6
ef63c6
ef63c6
%prep
ef63c6
%autosetup -p1 -n %{project}-%{shortname}-%{version}
ef63c6
ef63c6
ef63c6
%build
ef63c6
%py3_build
ef63c6
ef63c6
ef63c6
%install
ef63c6
%py3_install
ef63c6
ef63c6
mkdir -p %{buildroot}%{_sysconfdir}/%{longname}
ef63c6
install -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{longname}
ef63c6
ef63c6
mkdir -p %{buildroot}/%{_unitdir}
ef63c6
install -p -m644 %{_builddir}/%{project}-%{shortname}-%{version}/systemd/ipa-%{shortname}.service %{buildroot}%{_unitdir}
ef63c6
install -p -m644 %{_builddir}/%{project}-%{shortname}-%{version}/systemd/ipa-%{shortname}.timer %{buildroot}%{_unitdir}
ef63c6
ef63c6
mkdir -p %{buildroot}/%{_libexecdir}/ipa
ef63c6
install -p -m755 %{_builddir}/%{project}-%{shortname}-%{version}/systemd/ipa-%{shortname}.sh %{buildroot}%{_libexecdir}/ipa/
ef63c6
ef63c6
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
ef63c6
install -p -m644 %{_builddir}/%{project}-%{shortname}-%{version}/logrotate/%{longname} %{buildroot}%{_sysconfdir}/logrotate.d
ef63c6
ef63c6
mkdir -p %{buildroot}/%{_localstatedir}/log/ipa/%{shortname}
ef63c6
b9b3bb
mkdir -p %{buildroot}/%{_mandir}/man8
ef63c6
mkdir -p %{buildroot}/%{_mandir}/man5
b9b3bb
install -p -m644 %{_builddir}/%{project}-%{shortname}-%{version}/man/man8/ipa-%{shortname}.8  %{buildroot}%{_mandir}/man8/
ef63c6
install -p -m644 %{_builddir}/%{project}-%{shortname}-%{version}/man/man5/%{longname}.conf.5  %{buildroot}%{_mandir}/man5/
ef63c6
ef63c6
(cd %{buildroot}/%{python3_sitelib}/ipahealthcheck && find . -type f  | \
ef63c6
    grep -v '^./core' | \
ef63c6
    grep -v 'opt-1' | \
ef63c6
    sed -e 's,\.py.*$,.*,g' | sort -u | \
ef63c6
    sed -e 's,\./,%%{python3_sitelib}/ipahealthcheck/,g' ) >healthcheck.list
ef63c6
ef63c6
%post
ef63c6
%systemd_post ipa-%{shortname}.service
ef63c6
ef63c6
ef63c6
%preun
ef63c6
%systemd_preun ipa-%{shortname}.service
ef63c6
ef63c6
ef63c6
%postun
ef63c6
%systemd_postun_with_restart ipa-%{shortname}.service
ef63c6
ef63c6
ef63c6
%files -f healthcheck.list
ef63c6
%{!?_licensedir:%global license %%doc}
ef63c6
%license COPYING
ef63c6
%doc README.md
ef63c6
%{_bindir}/ipa-%{shortname}
ef63c6
%dir %{_sysconfdir}/%{longname}
ef63c6
%dir %{_localstatedir}/log/ipa/%{shortname}
ef63c6
%config(noreplace) %{_sysconfdir}/%{longname}/%{longname}.conf
ef63c6
%config(noreplace) %{_sysconfdir}/logrotate.d/%{longname}
ef63c6
%{python3_sitelib}/%{longname}-%{version}-*.egg-info/
ef63c6
%{python3_sitelib}/%{longname}-%{version}-*-nspkg.pth
ef63c6
%{_unitdir}/*
ef63c6
%{_libexecdir}/*
b9b3bb
%{_mandir}/man8/*
ef63c6
%{_mandir}/man5/*
ef63c6
ef63c6
%files -n %{name}-core
ef63c6
%{!?_licensedir:%global license %%doc}
ef63c6
%license COPYING
ef63c6
%doc README.md
ef63c6
%{python3_sitelib}/%{longname}/core/
ef63c6
ef63c6
ef63c6
%changelog
7ad35c
* Thu Feb 17 2022 Rob Crittenden <rcritten@redhat.com> - 0.7-10
7ad35c
- Don't depend on IPA status when suppressing pki checks (#2055316)
7ad35c
7ad35c
* Mon Jan 17 2022 Rob Crittenden <rcritten@redhat.com> - 0.7-9
7ad35c
- Don't assume the entry_point order when determining if there is a
7ad35c
  CA installed (#2041995)
7ad35c
7ad35c
* Thu Jan 06 2022 Rob Crittenden <rcritten@redhat.com> - 0.7-8
7ad35c
- Suppress the CRLManager check false positive when a CA is not
7ad35c
  configured (#1983060)
7ad35c
- Fix the backport of the pki.server.healthcheck suppression (#1983060)
7ad35c
235f5a
* Thu Oct 07 2021 Rob Crittenden <rcritten@redhat.com> - 0.7-7
235f5a
- ipa-healthcheck command takes some extra time to complete when dirsrv
235f5a
  instance is stopped (#1776687)
235f5a
- ipa-healthcheck complains about pki.server.healthcheck errors even CA
235f5a
  is not configured on the replica (#1983060)
235f5a
cf0866
* Mon Jun 14 2021 Rob Crittenden <rcritten@redhat.com> - 0.7-6
cf0866
- Fix patch fuzz issues, apply add'l upstream for log files (#1780020)
cf0866
cf0866
* Wed Jun  2 2021 Rob Crittenden <rcritten@redhat.com> - 0.7-5
cf0866
- Return a user-friendly message when no issues are found (#1780062)
cf0866
- Report on FIPS status (#1781107)
cf0866
- Detect mismatches beteween certificates in LDAP and filesystem (#1886770)
cf0866
- Verify owner/perms for important log files (#1780020)
cf0866
cf0866
* Tue Apr  6 2021 Rob Crittenden <rcritten@redhat.com> - 0.7-4
cf0866
- Add check to validate the KRA Agent is correct (#1894781)
cf0866
b9b3bb
* Fri Dec  4 2020 Rob Crittenden <rcritten@redhat.com> - 0.7-3
b9b3bb
- Translate result names when reading input from a json file (#1866558)
b9b3bb
b9b3bb
* Tue Nov  3 2020 Rob Crittenden <rcritten@redhat.com> - 0.7-2
b9b3bb
- Fix collection of AD trust domains (#1891505) 
b9b3bb
b9b3bb
* Tue Nov  3 2020 Rob Crittenden <rcritten@redhat.com> - 0.7-1
b9b3bb
- Update to upstream 0.7 (#1891850)
b9b3bb
- Include Directory Server healthchecks (#1824193)
b9b3bb
- Document that default output format is JSON (#1780328)
b9b3bb
- Fix return value on exit with --input-file (#1866558)
b9b3bb
- Fix examples in man page (#1809215)
b9b3bb
- Replace man page reference to output-format with output-type (#1780303)
b9b3bb
- Add dependencies on services to avoid false positives (#1780510)
b9b3bb
ef63c6
* Wed Aug 19 2020 Rob Crittenden <rcritten@redhat.com> - 0.4-6
ef63c6
- The core subpackage can be installed standalone, drop the Requires
ef63c6
  on the base package. (#1852244)
ef63c6
- Add Conflicts < 0.4 to to core to allow downgrading with
ef63c6
  --allowerasing (#1852244)
ef63c6
ef63c6
* Tue Aug  4 2020 Rob Crittenden <rcritten@redhat.com> - 0.4-5
ef63c6
- Remove the Obsoletes < 0.4 and add same-version Requires to each
ef63c6
  subpackage so that upgrades from 0.3 will work (#1852244)
ef63c6
ef63c6
* Thu Jan 16 2020 Rob Crittenden <rcritten@redhat.com> - 0.4-4
ef63c6
- Allow plugins to read contents from config during initialization (#1784037)
ef63c6
ef63c6
* Thu Dec  5 2019 Rob Crittenden <rcritten@redhat.com> - 0.4-3
ef63c6
- Add Obsoletes to core subpackage (#1780121)
ef63c6
ef63c6
* Mon Dec  2 2019 Rob Crittenden <rcritten@redhat.com> - 0.4-2
ef63c6
- Abstract processing so core package is standalone (#1771710)
ef63c6
ef63c6
* Mon Dec  2 2019 Rob Crittenden <rcritten@redhat.com> - 0.4-1
ef63c6
- Rebase to upstream 0.4 (#1770346)
ef63c6
- Create subpackage to split out core processing (#1771710)
ef63c6
- Correct URL (#1773512)
ef63c6
- Errors not translated to strings (#1752849)
ef63c6
- JSON output not indented by default (#1729043)
ef63c6
- Add dependencies to checks to avoid false-positives (#1727900)
ef63c6
- Verify expected DNS records (#1695125)
ef63c6
ef63c6
* Mon Aug 12 2019 Rob Crittenden <rcritten@redhat.com> - 0.3-4
ef63c6
- Lookup AD user by SID and not by hardcoded username (#1739500)
ef63c6
ef63c6
* Thu Aug  8 2019 Rob Crittenden <rcritten@redhat.com> - 0.3-3
ef63c6
- The AD trust agent and controller are not being initialized (#1738314)
ef63c6
ef63c6
* Mon Aug  5 2019 Rob Crittenden <rcritten@redhat.com> - 0.3-2
ef63c6
- Change DNA plugin to return WARNING if no range is set (#1737492)
ef63c6
ef63c6
* Mon Jul 29 2019 François Cami <fcami@redhat.com> - 0.3-1
ef63c6
- Update to upstream 0.3 (#1701351)
ef63c6
- Add logrotate configs + depend on anacron and logrotate (#1729207)
ef63c6
ef63c6
* Thu Jul 11 2019 François Cami <fcami@redhat.com> - 0.2-4
ef63c6
- Fix ipa-healthcheck.sh installation path (rhbz#1729188)
ef63c6
- Create and own log directory (rhbz#1729188)
ef63c6
ef63c6
* Tue Apr 30 2019 François Cami <fcami@redhat.com> - 0.2-3
ef63c6
- Add python3-lib389 to BRs
ef63c6
ef63c6
* Tue Apr 30 2019 François Cami <fcami@redhat.com> - 0.2-2
ef63c6
- Fix changelog
ef63c6
ef63c6
* Thu Apr 25 2019 Rob Crittenden <rcritten@redhat.com> - 0.2-1
ef63c6
- Update to upstream 0.2
ef63c6
ef63c6
* Thu Apr 4 2019 François Cami <fcami@redhat.com> - 0.1-2
ef63c6
- Explicitly list dependencies
ef63c6
ef63c6
* Tue Apr 2 2019 François Cami <fcami@redhat.com> - 0.1-1
ef63c6
- Initial package import