# running "notify" tasks serially on hosts

**URL:** <https://forum.ansible.com/t/running-notify-tasks-serially-on-hosts/16948>\
**Category:** Ansible Project\
**Created:** [December 3, 2014, 2:21pm UTC](https://forum.ansible.com/t/running-notify-tasks-serially-on-hosts/16948 "2014-12-03T14:21:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco\_Martinez](https://avatars.discourse-cdn.com/v4/letter/f/dec6dc/32.png) [@Francisco\_Martinez](https://forum.ansible.com/u/Francisco_Martinez)\
**Post date:** [December 3, 2014, 2:21pm UTC](https://forum.ansible.com/t/running-notify-tasks-serially-on-hosts/16948/1 "2014-12-03T14:21:16Z")

</div>

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](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

---

<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:** [December 3, 2014, 3:04pm UTC](https://forum.ansible.com/t/running-notify-tasks-serially-on-hosts/16948/2 "2014-12-03T15:04:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Francisco\_Martinez](https://avatars.discourse-cdn.com/v4/letter/f/dec6dc/32.png) [@Francisco\_Martinez](https://forum.ansible.com/u/Francisco_Martinez)\
**Post date:** [December 3, 2014, 3:08pm UTC](https://forum.ansible.com/t/running-notify-tasks-serially-on-hosts/16948/3 "2014-12-03T15:08:20Z")

</div>

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

---

<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:** [December 3, 2014, 3:20pm UTC](https://forum.ansible.com/t/running-notify-tasks-serially-on-hosts/16948/4 "2014-12-03T15:20:16Z")

</div>

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 ...
