mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #3040 from bfabio/devel
Support JSON in --extra-vars.
This commit is contained in:
commit
0837c9785f
2 changed files with 6 additions and 2 deletions
|
@ -98,6 +98,9 @@ def main(args):
|
|||
if options.sudo_user or options.ask_sudo_pass:
|
||||
options.sudo = True
|
||||
options.sudo_user = options.sudo_user or C.DEFAULT_SUDO_USER
|
||||
if options.extra_vars[0] in '[{':
|
||||
extra_vars = utils.json_loads(options.extra_vars)
|
||||
else:
|
||||
extra_vars = utils.parse_kv(options.extra_vars)
|
||||
only_tags = options.tags.split(",")
|
||||
|
||||
|
|
|
@ -53,7 +53,8 @@ environment variable.
|
|||
|
||||
*-e* 'VARS', *--extra-vars=*'VARS'::
|
||||
|
||||
Extra variables to inject into a playbook, in key=value key=value format.
|
||||
Extra variables to inject into a playbook, in key=value key=value format or
|
||||
as JSON (objects and arrays).
|
||||
|
||||
*-f* 'NUM', *--forks=*'NUM'::
|
||||
|
||||
|
|
Loading…
Reference in a new issue