# Batch size (serial) and playbook failing

**URL:** <https://forum.ansible.com/t/batch-size-serial-and-playbook-failing/35371>\
**Category:** Ansible Project\
**Created:** [June 18, 2021, 1:00pm UTC](https://forum.ansible.com/t/batch-size-serial-and-playbook-failing/35371 "2021-06-18T13:00:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Go\_Away](https://avatars.discourse-cdn.com/v4/letter/g/bc79bd/32.png) [@Go\_Away](https://forum.ansible.com/u/Go_Away)\
**Post date:** [June 18, 2021, 1:00pm UTC](https://forum.ansible.com/t/batch-size-serial-and-playbook-failing/35371/1 "2021-06-18T13:00:43Z")

</div>

Hi.  
I have a list of hosts of which some will always be unreachable or the tasks in playbook will otherwise fail. I have no problem with it. I cannot however understand why if I add “serial: 4” in my playbook and first four hosts fail, the playbook stops completely not even starting rest of the hosts.  
If I remove the batch size restriction, the play runs OK, reports failure for some hosts, but for the rest works well. If I try to control the batch size in order not to overload my laptop, I get the whole play to fail if first batch fails.  
There is no mention about this behaviour on [https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_strategies.html#setting-the-batch-size-with-serial](https://docs.ansible.com/ansible/latest/user_guide/playbooks_strategies.html#setting-the-batch-size-with-serial)  
(or I’m completely blind ;-))  
Any hints?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [June 18, 2021, 2:55pm UTC](https://forum.ansible.com/t/batch-size-serial-and-playbook-failing/35371/2 "2021-06-18T14:55:29Z")

</div>

This is by design, if all hosts in a batch fail, the playbook is  
failed. The logic was that in rolling releases it makes sense to stop  
in the case of a batch failing.

---

<div class="post-metadata">

**Author:** ![Go\_Away](https://avatars.discourse-cdn.com/v4/letter/g/bc79bd/32.png) [@Go\_Away](https://forum.ansible.com/u/Go_Away)\
**Post date:** [June 19, 2021, 9:59am UTC](https://forum.ansible.com/t/batch-size-serial-and-playbook-failing/35371/3 "2021-06-19T09:59:37Z")

</div>

Hmm. Would be great if the docs said so 😉  
But how to circumvent it? I can try using random order in order to reduce the probability of the same hosts failing every time but is there any other way?

pt., 18 cze 2021, 16:56 użytkownik Brian Coca \<[bcoca@redhat.com](mailto:bcoca@redhat.com)\> napisał:

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 19, 2021, 10:11am UTC](https://forum.ansible.com/t/batch-size-serial-and-playbook-failing/35371/4 "2021-06-19T10:11:46Z")

</div>

You could do a group of the hosts that you are able to connect to and exclude the rest. There are also certain Notations in the hosts and limit you can use to exclude the non connevtable hosts

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 19, 2021, 10:12am UTC](https://forum.ansible.com/t/batch-size-serial-and-playbook-failing/35371/5 "2021-06-19T10:12:47Z")

</div>

[https://docs.ansible.com/ansible/latest/user\_guide/intro\_patterns.html](https://docs.ansible.com/ansible/latest/user_guide/intro_patterns.html)
