I ran into this problem too. If you don't happen to use the 'uri' module, 
it's the double quotes that need to be escaped, not the curly's...

command: curl -XPUT "http://localhost:9200/_cluster/settings"; -d'{ 
\"transient\" : { \"cluster.routing.allocation.enable\" : \"none\" } }'

You need them for -H's too.
-H \"Content-Type: application/json\"

HTH,
-MJensen

On Tuesday, April 12, 2016 at 11:36:23 AM UTC-4, Ryan Groten wrote:
>
> I am trying to execute a task that runs the following command (which 
> includes a number of quote, brackets, colons, etc):
>
> command: curl -XPUT "http://localhost:9200/_cluster/settings"; -d'{ 
> "transient" : { "cluster.routing.allocation.enable" : "none" } }'
>
> I tried escaping all the quotes and {}, but that doesn't seem to work.  
>
> command: 'curl -XPUT "http://localhost:9200/_cluster/settings"; -d\'\{ 
> "transient" : \{ "cluster.routing.allocation.enable" : "none" \} \}''
>
> I also tried treating the whole command as a jinja string (I think?)
>
> command: {{ 'curl -XPUT "http://localhost:9200/_cluster/settings"; -d'{ 
> "transient" : { "cluster.routing.allocation.enable" : "none" } }'' }}
>
> Thanks,
> Ryan
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7411b320-d908-448c-a969-67e7e8d8c517%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to