I believe what you are looking for are handlers. See http://docs.ansible.com/playbooks_intro.html#handlers-running-operations-on-change
It allows you to define a task (handler) which can be notified to run by another task that returns a change. On Thu, Apr 30, 2015 at 7:11 AM, Toby Hobson <[email protected]> wrote: > I have a fairly typical set of tasks, which basically ensure that given > packages are installed and up to date. I can run the playbook several times > and ansible is smart enough to check whether the packages are already > installed before trying to install them again. Is there a way to tie in a > conditional restart similar to the way salt has watches? Basically I want > to restart the server only when a change has been made. > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/d6aaf35a-87eb-448e-9c33-9e67dd9c435c%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/d6aaf35a-87eb-448e-9c33-9e67dd9c435c%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Matt Martz @sivel sivel.net -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAD8N0v_Vzx-_bYPOBOHrORC__pqDCQe5TFx-NP-UOothK5StvQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
