# how to abort playbook run on first failed host during 'gathering facts' phase?

**URL:** <https://forum.ansible.com/t/how-to-abort-playbook-run-on-first-failed-host-during-gathering-facts-phase/18508>\
**Category:** Ansible Project\
**Created:** [June 15, 2015, 9:09pm UTC](https://forum.ansible.com/t/how-to-abort-playbook-run-on-first-failed-host-during-gathering-facts-phase/18508 "2015-06-15T21:09:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nusenu1](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Nusenu1](https://forum.ansible.com/u/Nusenu1)\
**Post date:** [June 15, 2015, 9:09pm UTC](https://forum.ansible.com/t/how-to-abort-playbook-run-on-first-failed-host-during-gathering-facts-phase/18508/1 "2015-06-15T21:09:29Z")

</div>

Hi,

my playbook/role requires that it is run against all given hosts.  
Proceeding in case of a single failed host would generate incomplete  
configs and must be prevented.

Is there a way to tell ansible-playbook to terminate/abort immediately  
as soon as one host fails the 'gathering facts' phase?  
(something better than manual ctrl-c?)

thanks,  
nusenu

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 15, 2015, 9:23pm UTC](https://forum.ansible.com/t/how-to-abort-playbook-run-on-first-failed-host-during-gathering-facts-phase/18508/2 "2015-06-15T21:23:59Z")

</div>

you might want to play with serial and max fails.  
[http://docs.ansible.com/playbooks\_delegation.html#maximum-failure-percentage](http://docs.ansible.com/playbooks_delegation.html#maximum-failure-percentage)

---

<div class="post-metadata">

**Author:** ![Nusenu1](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Nusenu1](https://forum.ansible.com/u/Nusenu1)\
**Post date:** [June 15, 2015, 11:23pm UTC](https://forum.ansible.com/t/how-to-abort-playbook-run-on-first-failed-host-during-gathering-facts-phase/18508/3 "2015-06-15T23:23:18Z")

</div>

Brian Coca:

> you might want to play with serial and max fails.  
> [http://docs.ansible.com/playbooks\_delegation.html](http://docs.ansible.com/playbooks_delegation.html)

thank you, I'll go with

max\_fail\_percentage: 1  
serial: 1

to abort on the first failed host.
