Commit 5c1ddb6f authored by ∞'s avatar 💻

Json variable support

parent 230a3938
Pipeline #2835 failed with stages
in 29 seconds
......@@ -28,7 +28,7 @@ test-playbook-executable:
./example/playbook.yml
grep hello ./playbook.out
test-clones-main:
test-clone-main:
<<: *test
script: |
bigsudo -v yourlabs.io/oss/yourlabs.bigsudo-example @localhost example_variable=$(pwd)/test1
......@@ -36,8 +36,9 @@ test-clones-main:
test-clone-update:
<<: *test
variables:
script: |
bigsudo -v yourlabs.io/oss/yourlabs.bigsudo-example @localhost example_variable=$(pwd)/test2 update
bigsudo -v yourlabs.io/oss/yourlabs.bigsudo-example update "{\"example_variable\": \"$(pwd)/test2\"}"
grep update test2
test-clone-local:
......
......@@ -62,6 +62,10 @@ def _argv(*hosts, **variables):
value = json.dumps(value)
argv += ['-e', key + '=' + shlex.quote(value)]
for value in console_script.parser.argv_all:
if value.startswith('{'):
argv += ['-e', shlex.quote(value)]
return argv
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment