Bug 2051582

Summary: Enable ipa-ccache-sweep.timer during server installation
Product: Red Hat Enterprise Linux 9 Reporter: Rob Crittenden <rcritten>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: frenaud, ipa-qe, myusuf, rcritten, tscherf
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.9.8-3.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2051575 Environment:
Last Closed: 2022-05-17 12:44:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2051575    
Bug Blocks:    

Description Rob Crittenden 2022-02-07 14:41:04 UTC
+++ This bug was initially created as a clone of Bug #2051575 +++

Cloned from upstream: https://pagure.io/freeipa/issue/9107

### Issue
Currently the ipa-ccache-sweep.timer is only enabled via the spec file when a server is already configured:
```
%posttrans server
# don't execute upgrade and restart of IPA when server is not installed
%{__python3} -c "import sys; from ipalib import facts; sys.exit(0 if facts.is_ipa_configured() else 1);" > /dev/null 2>&1

if [  $? -eq 0 ]; then
...
    /bin/systemctl is-enabled ipa-ccache-sweep.timer >/dev/null 2>&1
    if [  $? -eq 1 ]; then
        /bin/systemctl enable ipa-ccache-sweep.timer>/dev/null
    fi
fi
```
It should be explicitly enabled in the installer with: ```systemctl enable ipa-ccache-sweep.timer```

Noticed in 4.9.8 but this has been present since 4.9.0 when the feature was introduced.

--- Additional comment from Rob Crittenden on 2022-02-07 14:38:46 UTC ---

Upstream ticket:
https://pagure.io/freeipa/issue/9107

Comment 1 Rob Crittenden 2022-02-07 15:53:44 UTC
Upstream PR: https://github.com/freeipa/freeipa/pull/6168

Verification is, post-install on a fresh system:

/bin/systemctl is-enabled ipa-ccache-sweep.timer

Comment 7 Mohammad Rizwan 2022-02-22 07:11:21 UTC
version:
ipa-server-4.9.8-5.el9.x86_64
ipa-server-dns-4.9.8-5.el9.noarch



============================= test session starts ==============================
platform linux -- Python 3.9.10, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: /home/cloud-user/.pytest_cache
metadata: {'Python': '3.9.10', 'Platform': 'Linux-5.14.0-58.el9.x86_64-x86_64-with-glibc2.34', 'Packages': {'pytest': '6.2.2', 'py': '1.10.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.7.0', 'multihost': '3.0', 'sourceorder': '0.5', 'html': '3.1.1'}}
rootdir: /usr/lib/python3.9/site-packages/ipatests
plugins: metadata-1.7.0, multihost-3.0, sourceorder-0.5, html-3.1.1
collecting ... collected 4 items

test_integration/test_installation.py::TestInstallMasterKRA::test_install_master PASSED [ 25%]
test_integration/test_installation.py::TestInstallMasterKRA::test_ipa_ccache_sweep_timer_enabled PASSED [ 50%]
test_integration/test_installation.py::TestInstallMasterKRA::test_install_dns PASSED [ 75%]
test_integration/test_installation.py::TestInstallMasterKRA::test_kra_certs_renewal PASSED [100%]

=============================== warnings summary ===============================
../pytest_sourceorder.py:31
  /usr/lib/python3.9/site-packages/pytest_sourceorder.py:31: PytestUnknownMarkWarning: Unknown pytest.mark.source_order - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
    cls = pytest.mark.source_order(cls)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
---------------- generated xml file: /home/cloud-user/junit.xml ----------------
----------- generated html file: file:///home/cloud-user/report.html -----------
=================== 4 passed, 1 warning in 910.33s (0:15:10) ===================


Automation test passed, hence marking the test as verified.

Comment 10 errata-xmlrpc 2022-05-17 12:44:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: ipa), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2387