diff --git a/lib/ansible/modules/packaging/os/zypper.py b/lib/ansible/modules/packaging/os/zypper.py index 15281e0bce3..b9985960678 100644 --- a/lib/ansible/modules/packaging/os/zypper.py +++ b/lib/ansible/modules/packaging/os/zypper.py @@ -313,6 +313,9 @@ def get_cmd(m, subcommand): if (is_install or is_refresh) and m.params['disable_gpg_check']: cmd.append('--no-gpg-checks') + if subcommand == 'search': + cmd.append('--disable-repositories') + cmd.append(subcommand) if subcommand not in ['patch', 'dist-upgrade'] and not is_refresh: cmd.extend(['--type', m.params['type']])