dnf: obey the keepcache setting (#82735)

Fixes #81954
pull/82756/head
Martin Krizek 9 months ago committed by GitHub
parent 9a8be1e8c8
commit 77ab7afc3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
bugfixes:
- "dnf - fix an issue when cached RPMs were left in the cache directory even when the keepcache setting was unset (https://github.com/ansible/ansible/issues/81954)"

@ -1438,8 +1438,10 @@ class DnfModule(YumDnf):
if self.with_modules:
self.module_base = dnf.module.module_base.ModuleBase(self.base)
self.ensure()
try:
self.ensure()
finally:
self.base.close()
def main():

@ -67,6 +67,17 @@
update_cache: True
register: dnf_result
- find:
paths: /var/cache/dnf
patterns: "*.rpm"
recurse: true
register: r
- name: verify that RPM cache is cleared after installation as keepcache is off by default
assert:
that:
- r.matched == 0
- name: check sos with rpm
shell: rpm -q sos
failed_when: False

Loading…
Cancel
Save