This is a fairly common request. The suggestion has been to implement something like a "--force-handlers" switch to Ansible playbook that runs all of them.
I think having to name the handlers might be too unfriendly. --Michael On Sat, Mar 15, 2014 at 10:36 PM, Xu Chen <[email protected]> wrote: > I wonder if there is an elegant way to have a few tasks in a handler file, > and execute them either triggered by other tasks or forced based on an > input parameter. > > Here is the scenario I have in mind.. > 1) use ansible to sync a git repo, if that repo is updated, trigger a > build handler > 2) execute something else, which causes an error > > Since the handlers are executed in the end, if step 2) fails after step 1) > is executed (which updates the repo), the build handler is never executed. > The problem is that even if I fixed step 2), another Ansible run will not > trigger the build - since the repo is considered unchanged for the second > Ansible run. > > I can probably flush the handlers right after step 1), but I'd prefer not > do this. I wonder if I can pass in a parameter to ansible-play in the > second run, to force the build handler. Or maybe you guys have better > ideas? :-) Thanks.. > > -- > 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/6c4539f4-838d-4b2a-aef7-8dd6469f84f7%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/6c4539f4-838d-4b2a-aef7-8dd6469f84f7%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAEVJ8QNwxu-qO2H5%2BEQYfNU%3DH8eaRTmO0YWNJ%2B%2Bk4sJ-cUYzBA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
