Batch size (serial) and playbook failing

85 views
Skip to first unread message

Go Away

unread,
Jun 18, 2021, 9:00:43 AM6/18/21
to Ansible Project
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
 (or I'm completely blind ;-))
Any hints?

Brian Coca

unread,
Jun 18, 2021, 10:56:19 AM6/18/21
to Ansible Project
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.


--
----------
Brian Coca

Go Away

unread,
Jun 19, 2021, 6:00:00 AM6/19/21
to Ansible Project
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?

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/0n1otB2rzqI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7f7m4vw-JQgX87G-5NwSbb8hMc6X5mjSm%3DYs9kxROrNkQ%40mail.gmail.com.

Wei-Yen Tan

unread,
Jun 19, 2021, 6:12:04 AM6/19/21
to ansible...@googlegroups.com
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 

From: ansible...@googlegroups.com <ansible...@googlegroups.com> on behalf of Go Away <spadaj...@gmail.com>
Sent: Saturday, June 19, 2021 9:59:37 PM
To: Ansible Project <ansible...@googlegroups.com>
Subject: Re: [ansible-project] Batch size (serial) and playbook failing
 
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAP_RC6BEbWODUDoLY89CR0q%3DRJd7_1YE6BK9tZcXz5BMGiSisQ%40mail.gmail.com.

Wei-Yen Tan

unread,
Jun 19, 2021, 6:13:07 AM6/19/21
to ansible...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages