one task failed doesn't break the rest tasks in other roles

Hi guys,

I have role X with tasks a,b,c,d.
And I have another role Y with tasks e,f,g,h.
And I have host Z whcih I want to apply role X and role Y to.

If task b failed, how to let ansible continue to working on the rest task(e, f, g, h) in role Y?
Task b failed and I don’t want to let ansible run task c and d,
so “ignore_errors: yes” is not solution for me.

Thank you for your helping.

in 2.0 (current devel) you'll have blocks which will allow this:

block:
   - task a
   - task b
   - task c
   - task d
rescue:
   - debug: msg=skipping rest of block but continuing with play

which will discontinue errors in that set of tasks but will continue
with rest of the play.

Hi Brian,

Thank you for your helping. The new feature solves my problems.

I can’t wait to use ansible v2.

Brian Coca於 2015年8月18日星期二 UTC+8上午6時04分49秒寫道: