Oh yes, it was that ! I've forgotten that using shell module can eat quoting. Thanks ! :)
Sylvain 2016-09-02 22:50 GMT+02:00 Matt Martz <[email protected]>: > I imagine that the problem is that you need to quote what is being > echoed. Something like: > > shell: echo '{{ var | to_json }}' | jq > > On Fri, Sep 2, 2016 at 3:38 PM, Sylvain <[email protected]> wrote: > >> Hi ! >> >> I want to export YAML variable to JSON for use with *jq* tool but the >> last don't like JSON sent by Ansible. >> shell : 'echo {{ var | to_json }} | jq' >> >> For that work, I must quote keys and datas that seems the good way. See >> here : http://stackoverflow.com/questions/949449/json-spec-does- >> the-key-have-to-be-surrounded-with-quotes >> Is there any possibility to do that with Ansible ? >> >> Thanks, >> Sylvain >> >> -- >> 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/ms >> gid/ansible-project/26e1240d-d939-4fbe-a373-44d061152922% >> 40googlegroups.com >> <https://groups.google.com/d/msgid/ansible-project/26e1240d-d939-4fbe-a373-44d061152922%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Matt Martz > @sivel > sivel.net > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Ansible Project" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/ansible-project/E6Shuvt8mX4/unsubscribe. > To unsubscribe from this group and all its topics, 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/CAD8N0v-CjyWN7WJifh9_19UVXc0GL1bqV7zJzyc3YN_ > pKX6Weg%40mail.gmail.com > <https://groups.google.com/d/msgid/ansible-project/CAD8N0v-CjyWN7WJifh9_19UVXc0GL1bqV7zJzyc3YN_pKX6Weg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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/CALhNj%2BT-SfvSCO5YrVF02MRowzXfSFcO6Z1Z%3DtaK61EJASgWfA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
