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