Not really,
you get an response object with the key "json"
So something like:
'{{ response["json"] | to_json }}.key'
but this doesn't work..
Am Montag, 23. April 2018 11:03:20 UTC+2 schrieb Antonios Dimtsoudis:
>
> Hi,
>
>
> i have a problem with using the ansible json-filter.
> -->
> http://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#json-query-filter
>
> from an api-request i get a json response with a token.
>
> '{{ response["json"] | to_json }}'
> results in:
> {"name": "ltmetric", "key": "eyJrIj..."}
>
>
> How can i extract the key-value with the json filter and save it to a
> file? The solution must be really easy, but i didn't manage to solve it and
> tried out several versions of code..
>
> Right now i use echo and jq on shell to get the key, but i think that's
> not the best practice :-)
>
>
> Thanks,
> Toni.
>
--
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/e0ce741a-6473-45ef-9577-607dfcd42f7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.