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

**URL:** <https://forum.ansible.com/t/is-there-a-fact-to-identify-which-hosts-have-failed-out-of-a-run/13234>\
**Category:** Ansible Project\
**Created:** [August 1, 2013, 12:26am UTC](https://forum.ansible.com/t/is-there-a-fact-to-identify-which-hosts-have-failed-out-of-a-run/13234 "2013-08-01T00:26:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Golden](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@David\_Golden](https://forum.ansible.com/u/David_Golden)\
**Post date:** [August 1, 2013, 12:26am UTC](https://forum.ansible.com/t/is-there-a-fact-to-identify-which-hosts-have-failed-out-of-a-run/13234/1 "2013-08-01T00:26:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [August 1, 2013, 1:03am UTC](https://forum.ansible.com/t/is-there-a-fact-to-identify-which-hosts-have-failed-out-of-a-run/13234/2 "2013-08-01T01:03:17Z")

</div>

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).
