getting 'play recap' changed variable from playbook

Hi all,

if any play in a playbook actually changes something, I want to display a ‘please restart something’ message to the playbook user.
Is there a way to get the ‘PLAY RECAP’ changed variable value from a playbook ?

something like this pseudo playbook:

Hi all,

if any play in a playbook actually changes something, I want to display a
'please restart something' message to the playbook user.
Is there a way to get the 'PLAY RECAP' changed variable value from a
playbook ?

I think the only way is to write you own callback plugin.

something like this pseudo playbook:

---
- hosts: all
  tasks:
  - name: Do something
    shell: doit.sh

  - debug: msg="Please restart server to effectuate changes..."
    when: play_recap | Changed

I don't want a restart to get initiated from the playbook. The playbook
should be used to possibly make a configuration change,
and when it did change something, the user should be notified to schedule
the required restart later..

You could use a handler like so

Thanks Kai ! Will look into that…