On 10.01.2017 15:04, Pieter Voet wrote:
> 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
---
- hosts: all
tasks:
- name: Do something
shell: doit.sh
notify: Inform user to reboot
handlers:
- name: Inform user to reboot
debug: msg="Please restart server to effectuate changes..."
--
Kai Stian Olstad