How to ignore the failed plays, not just failed tasks ?

The whole play will only fail and abort the run when all hosts in the batch have failed.

(If serial: 10 is set for a rolling update, the batch size is 10, for example, otherwise it’s the size of the group).

That’s actually the problem. Since each play can target different servers, “all hosts” should include hosts in all plays. It should not abort the run because all hosts of ONE play failed. Other plays don’t get a chance to run. For example, I have 2 db servers and 5 web servers and 2 lb servers. Because all the db servers failed (or were shut down already), it aborted the run so none of the web server will be shut down properly.

“That’s actually the problem. Since each play can target different servers, “all hosts” should include hosts in all plays. It should not abort the run because all hosts of ONE play failed.”

I disagree, but in this case you may wish to execute playbooks with multiple ansible-playbook calls.

You may also want to consider just issuing the shutdown against the ‘all’ group, if that was your intent.

  1. How do you execute multiple ansible-playbook calls ? Any reference to document or example will be appreciated.
  2. We have to shut down different types of hosts in different ways so we cannot use “all” for all plays.

Possibly like so:

ansible-playbook foo.yml; ansible-playbook bar.yml

I’ll probably make my own post because this post is so old, but it is the same topic, so…

Is there a way to avoid aborting the run when all hosts in a serial batch have failed?

No, that is the 'serial' feature itself, to kill play if all the hosts
in a batch fail.