Passing extra_vars via curl does not work #2246
MatijaTerzic
started this conversation in
General
Replies: 2 comments 6 replies
-
did you figure this out? |
Beta Was this translation helpful? Give feedback.
6 replies
-
I figured out my issue, for whatever reason in need backslashes in my nested JSON to work. Full explanation here #2522 Hopefully this can help someone down the road. Thanks to @MatijaTerzic for the help. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a task with "Survey Variables" set to "hostnames" as a string. in my playbook i have :hosts: "{{ hostnames }}"
In the semaphore logs of the task i see this:
The error was: 'hostnames' is undefined. 'hostnames' is undefined
I use this curl command:
curl -v -XPOST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer my_token' -d '{
"template_id": 4,
"extra_vars": "{"hostnames":"docker"}"
}' https://semaphore_url/api/project/2/tasks
Beta Was this translation helpful? Give feedback.
All reactions