Fail module works great! Thanks.
I had to define my fact before checking it, otherwise I'd get an undefined variable error.
And I had issues when doing setting the fact with quotes and without spaces.
This worked:
set_fact: flag="failed"
This threw errors:
set_fact: flag = failed