How to notify a handler when using set_fact module?

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

`

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

this shoudl also work:

changed_when: True