From e4135b6f1939987af8a498e1e91d71b1dc260c9c Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Tue, 8 Jul 2025 10:57:35 +0200 Subject: [PATCH] yum_repository: remove deprecated keepcache option (#85441) --- .../yum_repository-remove-keepcache.yml | 2 ++ lib/ansible/modules/yum_repository.py | 17 +---------------- 2 files changed, 3 insertions(+), 16 deletions(-) create mode 100644 changelogs/fragments/yum_repository-remove-keepcache.yml diff --git a/changelogs/fragments/yum_repository-remove-keepcache.yml b/changelogs/fragments/yum_repository-remove-keepcache.yml new file mode 100644 index 00000000000..6c6222549c7 --- /dev/null +++ b/changelogs/fragments/yum_repository-remove-keepcache.yml @@ -0,0 +1,2 @@ +removed_features: + - yum_repository - remove deprecated ``keepcache`` option. diff --git a/lib/ansible/modules/yum_repository.py b/lib/ansible/modules/yum_repository.py index c43feee736d..013e85d2d8e 100644 --- a/lib/ansible/modules/yum_repository.py +++ b/lib/ansible/modules/yum_repository.py @@ -183,14 +183,6 @@ options: - This parameter is deprecated as it has no effect with dnf as an underlying package manager and will be removed in ansible-core 2.22. type: bool - keepcache: - description: - - Either V(1) or V(0). Determines whether or not yum keeps the cache of - headers and packages after successful installation. - - This parameter is deprecated as it is only valid in the main configuration - and will be removed in ansible-core 2.20. - choices: ['0', '1'] - type: str metadata_expire: description: - Time (in seconds) after which the metadata will expire. @@ -466,13 +458,7 @@ class YumRepo: for key, value in sorted(self.params.items()): if value is None: continue - if key == 'keepcache': - self.module.deprecate( - "'keepcache' parameter is deprecated as it is only valid in " - "the main configuration.", - version='2.20' - ) - elif key == 'async': + if key == 'async': self.module.deprecate( "'async' parameter is deprecated as it has been removed on systems supported by ansible-core", version='2.22', @@ -557,7 +543,6 @@ def main(): includepkgs=dict(type='list', elements='str'), ip_resolve=dict(choices=['4', '6', 'IPv4', 'IPv6', 'whatever']), keepalive=dict(type='bool'), - keepcache=dict(choices=['0', '1']), metadata_expire=dict(), metadata_expire_filter=dict( choices=[