mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Zypper: Fix update_cache in checkmode (#20143)
Fixes #20139 Refresh does not support dry-run, so don't run it in check mode. Also add a test for this case.
This commit is contained in:
parent
e4bfc2b84c
commit
4976429e42
2 changed files with 26 additions and 2 deletions
|
@ -95,7 +95,7 @@ options:
|
|||
update_cache:
|
||||
version_added: "2.2"
|
||||
description:
|
||||
- Run the equivalent of C(zypper refresh) before the operation.
|
||||
- Run the equivalent of C(zypper refresh) before the operation. Disabled in check mode.
|
||||
required: false
|
||||
default: "no"
|
||||
choices: [ "yes", "no" ]
|
||||
|
@ -449,7 +449,7 @@ def main():
|
|||
name = filter(None, name)
|
||||
|
||||
# Refresh repositories
|
||||
if update_cache:
|
||||
if update_cache and not module.check_mode:
|
||||
retvals = repo_refresh(module)
|
||||
|
||||
if retvals['rc'] != 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue