running "notify" tasks serially on hosts

Hello!

After changing a configuration in one service, I’d like to notify the services, but not concurrently on all the servers at once. So if I change the settings - that require a restart of apache and supervisord - I’d like the 100 hosts slowly restart apache/supervisord, one at a time. That restart is currently a handler in a role.

So far I’ve found the “serial” keyword, but according to the documentation I’ve found (http://docs.ansible.com/playbooks_delegation.html) it’s only related to plays, not to given tasks.

Is it possible to do it on a task/handler level?

Thanks in advance,
Fran

no, not currently.

what you might want to change it to have the actual handler execution
in a subsequent play, and have the current handler set the host in a
'needs restart' group (using group_by). This way the original play can
be concurrent and the new play will using this new group with serial 1
and have the task to do the restart.

Ouch, I don’t even know how to concatenate plays automatically, so I’ll have to do some homework. Thanks!

you can keep several plays in the same file and/or run multiple files
from the same command line:

ansible-playbook file1.yml file2.yml ...