It works !!

On Fri, Feb 10, 2017 at 12:12 AM, Johannes Kastl <[email protected]> wrote:

> On 09.02.17 19:36 DHAVAL JAISWAL wrote:
> > I want to use the failed_when in following ad-hoc command to ignore
> > the error. Is there any other alternative can be handle in ad hoc
> > command.
> >
> > /usr/bin/ansible node1 -a "grep 'value1' /tmp/test.log"
>
> As nobody came up with a solution, I would assume that failed_when is
> only applicable to tasks, not to ad-hoc commands.
>
> Workaround: Use the shell module and make your command exit with an
> error != 1:
>
> /usr/bin/ansible node1 -m shell -a "grep 'value1' /tmp/test.log || exit 0"
>
>
> Johannes
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/ansible-project/_NnsHPwj5kU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/50962d2a-04f8-6c0c-3172-e5fa52d09bef%40ojkastl.de.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks & Regards
Dhaval Jaiswal

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAH5ShBj1UUkqGs9BCm4%3Dx9Vv8fgkkv%3DQ_fCV_3W2GqoZyFc8mQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to