# getting 'play recap' changed variable from playbook

**URL:** <https://forum.ansible.com/t/getting-play-recap-changed-variable-from-playbook/23417>\
**Category:** Ansible Project\
**Created:** [January 10, 2017, 2:04pm UTC](https://forum.ansible.com/t/getting-play-recap-changed-variable-from-playbook/23417 "2017-01-10T14:04:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pieter\_Voet](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pieter\_Voet](https://forum.ansible.com/u/Pieter_Voet)\
**Post date:** [January 10, 2017, 2:04pm UTC](https://forum.ansible.com/t/getting-play-recap-changed-variable-from-playbook/23417/1 "2017-01-10T14:04:58Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 11, 2017, 10:13am UTC](https://forum.ansible.com/t/getting-play-recap-changed-variable-from-playbook/23417/2 "2017-01-11T10:13:59Z")

</div>

> 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  
> &nbsp;&nbsp;tasks:  
> &nbsp;&nbsp;- name: Do something  
> &nbsp;&nbsp;&nbsp;&nbsp;shell: doit.sh
> 
> &nbsp;&nbsp;- debug: msg="Please restart server to effectuate changes..."  
> &nbsp;&nbsp;&nbsp;&nbsp;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

---

<div class="post-metadata">

**Author:** ![Pieter\_Voet](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pieter\_Voet](https://forum.ansible.com/u/Pieter_Voet)\
**Post date:** [January 11, 2017, 4:12pm UTC](https://forum.ansible.com/t/getting-play-recap-changed-variable-from-playbook/23417/3 "2017-01-11T16:12:13Z")

</div>

Thanks Kai ! Will look into that…
