I have a trivial task that I am stuck to write salt state for. I need to call REST endpoint using curl with json body. This is
curl localhost/endpoint -d '{"some" : "data"}'
My idea was to simply take this and put it into salt state by using cmd.run
. Does not work. So far I have this:
{%- set data = {'some': 'data'} %}
Use echo instead of curl:
cmd.run:
- name: echo '{{ data|json }}'
And this gives me
failed: Unknown yaml render error; line 5
Use echo instead of curl:
cmd.run:
- name: echo '{"some": "data"}' <======================
I have Salt version 2014.7.1