Right now handlers are just about notifying things in the context of one
host.

There's not (yet) a concept of a global handler, nor really a "global:
True" kind of variant on set_fact.  If there were, it would be easy to set
a global flag True if a particular host hit a state, and then use that
state to trigger actions on another set, without having to rely on the
result of just one particular host, which you can already do with hostvars.

Sorry if this doesn't entirely make sense.

There are ways you could do it that are a little bit hackish, like creating
a signal file with a handler that delegated to localhost, but mass
delegation to localhost with 500 systems is usually going to make your
control server unhappy.

I think it's about time we do have a "set_global" that a handler could
call, and you could use that in another play.  Seems like a good idea now.





On Thu, Jul 24, 2014 at 9:38 AM, Michael Peters <[email protected]>
wrote:

> On Thu, Jul 24, 2014 at 7:00 AM, Michael DeHaan <[email protected]>
> wrote:
>
> > You could also set a simple play like this, which would probably be
> cleaner:
> >
> > - hosts: blarg
> >   serial: 1
> >   tasks:
> >     - pause: seconds={{ n }}
> >     - service: name=foo state=restarted
>
> Is there a way to do something like this as a handler? I think that's
> the main problem here is that a configuration change should trigger a
> restart handler, but right now there's no way to throttle/serialize
> the execution of that handler. Unless I'm missing something...
>
> --
> 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/CAJQqANe3_nycqbbpcRTEjwck1%2BcmaDQBd3cFgzW6-Y7EphuYKg%40mail.gmail.com
> .
> 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/CA%2BnsWgyWab7dS8Ht2gq%3DxajO99ymkF2ztPos_Ai%3Dd9Yso2c-iw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to