# How to notify a handler when using set\_fact module?

**URL:** <https://forum.ansible.com/t/how-to-notify-a-handler-when-using-set-fact-module/24744>\
**Category:** Ansible Project\
**Created:** [June 16, 2017, 6:57am UTC](https://forum.ansible.com/t/how-to-notify-a-handler-when-using-set-fact-module/24744 "2017-06-16T06:57:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Godorogea](https://avatars.discourse-cdn.com/v4/letter/i/e19b73/32.png) [@Ivan\_Godorogea](https://forum.ansible.com/u/Ivan_Godorogea)\
**Post date:** [June 16, 2017, 6:57am UTC](https://forum.ansible.com/t/how-to-notify-a-handler-when-using-set-fact-module/24744/1 "2017-06-16T06:57:00Z")

</div>

Hi,

I am trying to notify a handler in a set\_fact task, but it doesn’t work.  
Is that not implemented or I’m doing it wrong?

Thank you,  
Ivan

Here are the code snippets:

> **/tasks/main.yml**

`

---

<div class="post-metadata">

**Author:** ![Sergey\_Baranov](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@Sergey\_Baranov](https://forum.ansible.com/u/Sergey_Baranov)\
**Post date:** [June 19, 2017, 5:56pm UTC](https://forum.ansible.com/t/how-to-notify-a-handler-when-using-set-fact-module/24744/2 "2017-06-19T17:56:07Z")

</div>

> Hi

_notify_ action is triggered when task have made a change on the remote system.  
Seems you problem is that _set\_fact_ module doesn’t make changes on the remote server. Try to use _changed\_when_ with _set\_fact_ module

`

- name: Store fact into role variable  
set\_fact:  
important\_fact: “fact”  
changed\_when: “important\_fact==‘fact’”  
notify: fact stored  
`

hope this helps

---

<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:** [June 19, 2017, 9:30pm UTC](https://forum.ansible.com/t/how-to-notify-a-handler-when-using-set-fact-module/24744/3 "2017-06-19T21:30:09Z")

</div>

this shoudl also work:

changed\_when: True
