Re: [ansible-project] with_items to get values from a shell cmd output

2020-04-09 Thread Kiran Kumar
@Dick Visser *Wow, that helped, thanks a lot ! * *Thanks for the valuable suggestions & nice explanation as well * On Thursday, April 9, 2020 at 12:31:02 AM UTC-7, Dick Visser wrote: > > The result from your grep/awk shell task consists of multiple lines, each > with one PID. > So instead

Re: [ansible-project] with_items to get values from a shell cmd output

2020-04-09 Thread Stefan Hornburg (Racke)
On 4/9/20 9:30 AM, Dick Visser wrote: > The result from your grep/awk shell task consists of multiple lines, each > with one PID. > So instead of stdout you should use > stdout_lines:  > https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#stdout-lines >   > >

Re: [ansible-project] with_items to get values from a shell cmd output

2020-04-09 Thread Dick Visser
The result from your grep/awk shell task consists of multiple lines, each with one PID. So instead of stdout you should use stdout_lines: https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#stdout-lines Also, you are iterating over a list of 1 item, which is

[ansible-project] with_items to get values from a shell cmd output

2020-04-09 Thread Kiran Kumar
I got this error for below code - FAILED! => {"msg": "template error while templating string: expected token 'end of print statement', got '='. String: {{ var=oom.stdout }}"} Please suggest , i am trying to get pid from shell cmd & then update it with echo - hosts: temp > gather_facts: