# "when" condition in handler is not honored

**URL:** <https://forum.ansible.com/t/when-condition-in-handler-is-not-honored/21771>\
**Category:** Ansible Project\
**Created:** [June 14, 2016, 2:41pm UTC](https://forum.ansible.com/t/when-condition-in-handler-is-not-honored/21771 "2016-06-14T14:41:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guy\_Matz1](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Guy\_Matz1](https://forum.ansible.com/u/Guy_Matz1)\
**Post date:** [June 14, 2016, 2:41pm UTC](https://forum.ansible.com/t/when-condition-in-handler-is-not-honored/21771/1 "2016-06-14T14:41:55Z")

</div>

Hi!  
I have a "when: condition that works fine in “regular” tasks, but not in a handler . . . is that expected?

So I’m using a notify, then at the end of the handler task I have a when condition. The notification works, but it always triggers, ever when the condition is false.

Here’s the handler:

- name: restart render  
supervisorctl:  
name: “render”  
state: restarted  
when: “‘render’ in group\_names”

Any ideas?

Thanks a lot,  
Guy
