A way to check the error message returned by module in "msg"

21 views
Skip to first unread message

Co S

unread,
Jan 8, 2016, 9:01:59 AM1/8/16
to Ansible Project
Hi All,

Is there any way to check the check the message error text returned by module in msg against some pattern?

I want to skip execution of next task if msg contains "LoadBalancerNotFound" string.

TASK: [elb | Wait ELB to deassociate from SG] *********************************
failed
: [127.0.0.1] => {"attempts": 0, "failed": true}
msg
: LoadBalancerNotFound: Cannot find Load Balancer test

FATAL
: all hosts have already failed -- aborting


Thanks,
Regards

Brian Coca

unread,
Jan 8, 2016, 10:20:08 AM1/8/16
to Ansible Project
use register to put the return info into a var, then you can use it to
scan for the match.
> --
> 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-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/209f9958-e94b-437b-acff-a828171e7c5a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Brian Coca

Co S

unread,
Jan 8, 2016, 11:14:10 AM1/8/16
to Ansible Project
I registered variable. What's the best way to scan for the match?
Reply all
Reply to author
Forward
0 new messages