THanks Vlad !
I will use same !

Regards
Rahul

On Mon, 13 Jul 2020 at 19:47, Vladimir Botka <vbo...@gmail.com> wrote:

> On Fri, 10 Jul 2020 17:24:05 +0530
> Rahul Kumar <rajput4u4...@gmail.com> wrote:
>
> > I have a task output like this:
> > - name: Print Response of status resource
> >   debug:
> >     msg: " {{ result }}"
> >
> > ok: [node-3] => {
> >     "msg": " {'msg': u'All items completed', 'changed': False, 'results':
> > [{'ansible_loop_var': u'item', 'failed': False, 'changed': False,
> > u'content': {u'body': None, u'node': u'node-3', u'allServicesLocked':
> True,
> > u'appServer': u'1', u'type': u'iMIME', u'data': True,]} "
> > }
>
> Use "yaml" callback plugin when you want to see complex structures. For
> example, this task
>
>   - debug:
>       var: result
>
> would give
>
>   shell> ANSIBLE_STDOUT_CALLBACK=yaml ansible-playbook test.yml
>
>   result:
>     changed: false
>     msg: All items completed
>     results:
>     - ansible_loop_var: item
>       changed: false
>       content:
>         allServicesLocked: true
>         appServer: '1'
>         body: None
>         data: true
>         node: node-3
>         type: iMIME
>       failed: false
>
> Then, it's easier to find an expression which you're probably looking for
>
>   - debug:
>       var: result.results.0.content.data
>
> HTH,
>
>         -vlado
> --
> Vladimir Botka
>

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGH8rEwzLscKb0_8y4kZx60LexkHwh-J3twYQXqkPp%2Br6-B0Og%40mail.gmail.com.

Reply via email to