Something like this should work:
[wani@linux tmp ]$ cat a.yaml
- hosts: localhost
tasks:
- command: 'echo {\"key\": \"value\"}'
register: my_output
- debug:
msg: "{{ my_output.stdout | from_json }}"
On, run, it will show:
TASK [debug] ********************************************************************************************************************************************************************************
task path: /tmp/a.yaml:7
ok: [localhost] => {
"changed": false,
"msg": {
"key": "value"
> --
> 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
ansible-proje...@googlegroups.com.
> To post to this group, send email to
ansible...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/42641283-4ea2-43fe-941a-6c8bf4e548af%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
--
Nehal J Wani