-e 'versions.myapp="0.1.2"' vs -e '{ "versions": { "myapp": "0.1.2"} }' => Rundeck job import, ":" -> yaml: mapping values are not allowed here

26 views
Skip to first unread message

sirkubax

unread,
Dec 18, 2015, 6:47:18 AM12/18/15
to Ansible Project
Is there any way to pass an extra_vars in a form of dict, not json?
Like this:
-e 'versions.myapp="0.1.2"'
not like that:
-e  '{ "versions": { "myapp": "0.1.2"} }'

Reason - while importing jobs into rundeck it does complain about

Error: Failed request to load jobs: Jobs Document was invalid for format yaml: mapping values are not allowed here
-e  '{"versions": {"promo
                       ^

(or - can some escaping in rundeck while importing yaml files)

sirkubax

unread,
Dec 18, 2015, 6:59:44 AM12/18/15
to Ansible Project
Ok - I made it work in rundeck import

http://symfony.com/doc/current/components/yaml/yaml_format.html
"Mappings use a colon followed by a space (: ) to mark each key/value pair:"

So I did some nasty change, removing the space in the JSON - it does not look well, but it works:
-e  '{ "versions": { "myapp": "0.1.2"} }'
-e  '{ "versions":{ "myapp":"0.1.2"} }'

The initial question is still open, if You would feel like finding a solution.

sirkubax

unread,
Dec 18, 2015, 11:04:31 AM12/18/15
to Ansible Project
I was to happy, 
it does import to rundeck, but then the commands (that works in shell), when executed via rundec, looses double-quotes, and a JSON fails to create the dict (Expecting property name enclosed in double quotes)
Reply all
Reply to author
Forward
0 new messages