A when statement supplied to flush_handlers has never worked. It was silently ignored in the past, but now has a warning.
There is an open feature request to allow this to work: https://github.com/ansible/ansible/issues/41313 On Thu, Nov 29, 2018 at 1:09 PM Frank Thommen <[email protected]> wrote: > Hello, > > our latest yum update brought ansible from 2.4.2.0 to 2.7.2 and now we > are facing > > [WARNING]: flush_handlers task does not support when conditional > > we need the handlers to be flushed at that point, as later tasks rely on > previously reconfigured services to be reloaded. The "when" originates > from our role definition: > > ---------------------- > - hosts: all > name: "====== BLAH ======" > roles: > - { role: blah, when: has_blah|default(False) } > tags: > - blah-only > ---------------------- > (has_blah is an inventory variable, the hosts which "have blah" are > spread over all our host groups. To organize them in a separate host > group would be too much overhead as this characteristic can change very > often). > > I can't find this restriction mentioned anywhere in the changelogs or > the documentation of handlers or "meta" and I wonder > > a) why this - IMHO irritating - change of behaviour has been introduced > > and > > b) what would be the best way to work around it > > > Any help or hint is appreciated. > > > frank > > > -- > 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/f9ecce8b-2c47-472d-ad1e-9074f3894070%40drosera.ch > . > 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/CAD8N0v95xvMwYZmJP0Lqh%3Drq3rxeDiEg4xCXB%3Dp09yFVra1z-A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
