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

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

use register to put the return info into a var, then you can use it to
scan for the match.

I registered variable. What’s the best way to scan for the match?