/tasks/main.yml
---
...
- name: Store fact into role variable set_fact: important_fact: "{{ read_tmpfile_cmd.stdout }}" when: - "'stdout' in read_tmpfile_cmd" - read_tmpfile_cmd.stdout != '' notify: fact stored
/handlers/main.yml
---- name: fact stored
debug: msg: "Important fact: {{ important_fact}}"
Hi
- name: Store fact into role variable
set_fact:
important_fact: "fact"
changed_when: "important_fact=='fact'"
notify: fact stored