mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
parent
334b291720
commit
f51a6ea832
2 changed files with 27 additions and 1 deletions
|
@ -62,6 +62,12 @@ options:
|
|||
choices: [ package, patch, pattern, product, srcpackage, application ]
|
||||
default: "package"
|
||||
version_added: "2.0"
|
||||
extra_args_precommand:
|
||||
version_added: "2.6"
|
||||
required: false
|
||||
description:
|
||||
- Add additional global target options to C(zypper).
|
||||
- Options should be supplied in a single line as if given in the command line.
|
||||
disable_gpg_check:
|
||||
description:
|
||||
- Whether to disable to GPG signature checking of the package
|
||||
|
@ -308,7 +314,9 @@ def get_cmd(m, subcommand):
|
|||
is_install = subcommand in ['install', 'update', 'patch', 'dist-upgrade']
|
||||
is_refresh = subcommand == 'refresh'
|
||||
cmd = ['/usr/bin/zypper', '--quiet', '--non-interactive', '--xmlout']
|
||||
|
||||
if m.params['extra_args_precommand']:
|
||||
args_list = m.params['extra_args_precommand'].split()
|
||||
cmd.extend(args_list)
|
||||
# add global options before zypper command
|
||||
if (is_install or is_refresh) and m.params['disable_gpg_check']:
|
||||
cmd.append('--no-gpg-checks')
|
||||
|
@ -464,6 +472,7 @@ def main():
|
|||
name=dict(required=True, aliases=['pkg'], type='list'),
|
||||
state=dict(required=False, default='present', choices=['absent', 'installed', 'latest', 'present', 'removed', 'dist-upgrade']),
|
||||
type=dict(required=False, default='package', choices=['package', 'patch', 'pattern', 'product', 'srcpackage', 'application']),
|
||||
extra_args_precommand=dict(required=False, default=None),
|
||||
disable_gpg_check=dict(required=False, default='no', type='bool'),
|
||||
disable_recommends=dict(required=False, default='yes', type='bool'),
|
||||
force=dict(required=False, default='no', type='bool'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue