Hi Matt Martz

Excellent solution. For my windows role I have to change to
agent["stdout_lines"]|select('search','COMPLETED')|list != []

Best Regards
Jenisha T
Whatsapp: +91 07598087866





On Tue, 5 May 2020 at 02:53, Matt Martz <m...@sivel.net> wrote:

> agent.stdout_lines|select('search', 'COMPLETED')|list != []
>
> On Mon, May 4, 2020 at 4:18 PM Jenisha T <joyj...@gmail.com> wrote:
>
>> My output from script execution is
>>
>> agent: {
>>  "stdout_lines": [ The network is reachable. ........Connected using
>> winrm, executin COMPLETED  at 4/5, The file is saved at D:\  ]
>> }
>>
>>
>> I want to extract 'COMPLETED' from this list.
>>
>> In python logic:
>>
>> listToStr = ' '.join([str(elem) for elem in agent["stdout_lines"]])
>> iscomp='COMPLETED' in listToStr
>>
>> How to covert this into ansible.
>>
>>
>> --
>> 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/18189cc9-a3fa-4b72-8fd7-2da14f12efdf%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/18189cc9-a3fa-4b72-8fd7-2da14f12efdf%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
> Matt Martz
> @sivel
> sivel.net
>
> --
> 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/CAD8N0v9dmAyZbb%2BOROx_BCvSUBrQxhCbjg6G66%2B9H5B%3D9COubg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAD8N0v9dmAyZbb%2BOROx_BCvSUBrQxhCbjg6G66%2B9H5B%3D9COubg%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/CAAGhZYgBjtjRvbw90xuVseSGVyj_DTDPF%3D6ddyTKGH3w8CF0cg%40mail.gmail.com.

Reply via email to