Try by removing quotes result[results][0].content.data
On Fri, Jul 10, 2020 at 8:04 PM Rahul Kumar <rajput4u4...@gmail.com> wrote: > Thanks Abhijeet ! I tried even result[‘results’][0].content.data but still > it complains results is not dict attribute ! > > On Fri, 10 Jul 2020 at 5:32 PM, Abhijeet Kasurde <akasu...@redhat.com> > wrote: > >> 'data' is inside 'content' you might want to check around that >> >> >> On Fri, Jul 10, 2020 at 5:24 PM 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,]} " >>> } >>> >>> But when i try to access like that in some task, it does not work: >>> until : result['results'].data == True , it complains saying dict does >>> not have results attribute ! >>> Here result is my registered variable. As per above response , it should >>> work fine ? >>> >>> >>> -- >>> 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/CAGH8rEyOHqmrA7diB3AznLqRncRaj_r539gA5-oZpkEwMrzwCA%40mail.gmail.com >>> <https://groups.google.com/d/msgid/ansible-project/CAGH8rEyOHqmrA7diB3AznLqRncRaj_r539gA5-oZpkEwMrzwCA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >> >> >>> >> >> -- >> Thanks, >> Abhijeet Kasurde >> >> -- >> 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/CAFwWkHpb0WcE8jKLcPsM2i1mzA_PX%2BGBRF7Jtefqtmp4wFC6Sw%40mail.gmail.com >> <https://groups.google.com/d/msgid/ansible-project/CAFwWkHpb0WcE8jKLcPsM2i1mzA_PX%2BGBRF7Jtefqtmp4wFC6Sw%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > 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/CAGH8rEwgRWxNLYf1WaxNyqb7e0gmEDyC4nMZnw_0wwUJa32_ew%40mail.gmail.com > <https://groups.google.com/d/msgid/ansible-project/CAGH8rEwgRWxNLYf1WaxNyqb7e0gmEDyC4nMZnw_0wwUJa32_ew%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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/CAG-N3P7fK4PGzb7OKmfSyvsSB9tLSmipVNLoPW%3DPdfe7EwGzTA%40mail.gmail.com.