# Notify without using handlers?

**URL:** <https://forum.ansible.com/t/notify-without-using-handlers/13262>\
**Category:** Ansible Project\
**Created:** [August 6, 2013, 4:55pm UTC](https://forum.ansible.com/t/notify-without-using-handlers/13262 "2013-08-06T16:55:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanchan404](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@ryanchan404](https://forum.ansible.com/u/ryanchan404)\
**Post date:** [August 6, 2013, 4:55pm UTC](https://forum.ansible.com/t/notify-without-using-handlers/13262/1 "2013-08-06T16:55:23Z")

</div>

Hi,

In my cookbook, I have a lot of notify statements, e.g.

notify:

- restart apache

notify:

- restart mysql

handlers:

- name: restart apache  
service: name=httpd state=restarted

…many handlers…

And all these need to be specified in handlers, sound not elegant, right?  
are there any better way to do it? e.g. notify to restart directly?

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [August 6, 2013, 5:43pm UTC](https://forum.ansible.com/t/notify-without-using-handlers/13262/2 "2013-08-06T17:43:29Z")

</div>

You can always have the “service: name=httpd state=restarted” anywhere in your play, as long as isn’t required that it be run at the end of the play. There is no requirement that it has to be specified in a handler.
