Is there a fact to identify which hosts have failed out of a run?

I have a looping template and I’d like it to loop only over hosts which have not yet failed during a run.

I know how to loop over the group, but I don’t know if there’s a variable set to identify the status of a host (ok, failed, unreachable, etc.)

Thanks,
David

That’s a neat idea.

Presently, no, there’s not.

I’m open to having the system set a fact on a failed hosts automatically though. That probably wouldn’t be too difficult. (like ‘failed’ : True)

(Also, in some cases, I’d imagine you’d want all hosts that haven’t failed, even if selected further down in the play, which could be complicated by the add_host module, etc).