# Multiple levels of handlers, virtual notifications or...

**URL:** <https://forum.ansible.com/t/multiple-levels-of-handlers-virtual-notifications-or/12240>\
**Category:** Ansible Project\
**Created:** [January 23, 2013, 8:22pm UTC](https://forum.ansible.com/t/multiple-levels-of-handlers-virtual-notifications-or/12240 "2013-01-23T20:22:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nolan\_Darilek](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@Nolan\_Darilek](https://forum.ansible.com/u/Nolan_Darilek)\
**Post date:** [January 23, 2013, 8:22pm UTC](https://forum.ansible.com/t/multiple-levels-of-handlers-virtual-notifications-or/12240/1 "2013-01-23T20:22:28Z")

</div>

Here's something else I'd like to model.

I was thinking of using Ansible to provision SSL certificates. I can start a host out on a self-signed cert, then just push out a real one once I buy it.

The problem I'm anticipating is restarting a variety of services across disparate machine types when the SSL certificate updates. My app servers may only need Nginx restarted, whereas my personal VPS may need Nginx, Postfix, Dovecot and Prosody. I don't want to call each and every service handler when a SSL certificate updates, because I don't know that a given service will even be running on a certain system.

Is there any way to model this? Would tagging help? I'd be fine with tagging certain tasks with ssl, not running them by default, then having the SSL copy run them on change. Or maybe handlers can be aliased/merged such that "restart nginx" also means "update ssl", and the handler merges everything currently loaded with the "update ssl" alias? None of that seems particularly clean, so I'm wondering if this is even possible?

Thanks.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [January 23, 2013, 8:30pm UTC](https://forum.ansible.com/t/multiple-levels-of-handlers-virtual-notifications-or/12240/2 "2013-01-23T20:30:40Z")

</div>

You can notify multiple handlers, not sure you can use a var from the  
host\_vars, but I would try that.

action: change ssl  
notify: $myhandlers

---

<div class="post-metadata">

**Author:** ![Nolan\_Darilek](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@Nolan\_Darilek](https://forum.ansible.com/u/Nolan_Darilek)\
**Post date:** [January 28, 2013, 11:00pm UTC](https://forum.ansible.com/t/multiple-levels-of-handlers-virtual-notifications-or/12240/3 "2013-01-28T23:00:06Z")

</div>

> You can notify multiple handlers, not sure you can use a var from the  
> host\_vars, but I would try that.
> 
> action: change ssl  
> notify: $myhandlers
> 
> Just tried, didn't work claiming my handler was undefined.

Should I open a ticket for post-1.0?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [January 28, 2013, 11:34pm UTC](https://forum.ansible.com/t/multiple-levels-of-handlers-virtual-notifications-or/12240/4 "2013-01-28T23:34:41Z")

</div>

This is probably yet another thing we need to explictly call the  
template engine on -- easy fix.

Sure, let's have a ticket.

Thanks!
