mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-03 23:14:02 -07:00
Support JSON in --extra-vars.
If --extra-vars starts with either a '{' or a '[', it will be assumed we are dealing with JSON and parse the data as such.
This commit is contained in:
parent
5ec35fa388
commit
6bef150695
2 changed files with 6 additions and 2 deletions
|
@ -98,7 +98,10 @@ 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
|
||||
extra_vars = utils.parse_kv(options.extra_vars)
|
||||
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(",")
|
||||
|
||||
for playbook in args:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue