Interesting. But people would expect a time of "deprecated but works" at the least. And besides, I find the original way more logical. (Which will be so for more people, necessitating a deprecation warning, not a complete failure)
I'm noticing a lot of stuff gone, sort of broken, changed behavior, between these two ansible versions. Not good for the mindset of people who I just managed to get onboard with Ansible. Thanks, Mark On Thursday, February 11, 2016 at 2:43:21 PM UTC+1, Matt Martz wrote: > > This is expected. `when` statements work on each iteration of the `with_` > loop, and as such the `when` statements are effectively inspected *after* > `with_` loops. > > Ansible 1.9 may have allowed this to pass due to a bug in logic, however > 2.0 is more strict, and is properly failing. > > On Thu, Feb 11, 2016 at 7:38 AM, Mark Maas <[email protected] > <javascript:>> wrote: > >> Hi List, >> >> So I got this great thing here: >> >> ``` >> - name: Copy custom nrpe plugins >> template: >> src: "{{ item }}" >> dest: "{{ nrpe.plugins }}" >> mode: 0755 >> owner: "{{ nrpe.user }}" >> group: "{{ nrpe.user }}" >> tags: update_nrpe >> notify: restart nrpe >> with_fileglob: "../templates/plugins/{{ nrpe_scripts }}/*" >> when: nrpe_scripts is defined >> ``` >> >> Works a treat with 1.9, it would be really easy to add service checks for >> special server cases. >> With Ansible 2.0.0.2 this breaks, because 2.0 tries to fill the fileglob >> before looking at the when: conditional. And since the nrpe_scripts is not >> defined for most servers, it breaks! >> >> An ugly hack would be to put a general variable in group_vars/all that >> just makes it look into an empty directory or something. >> >> Is this a bug? or intended? >> >> Thanks, >> Mark >> >> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/f4fc3672-c449-4b92-bb35-f72a65106919%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/f4fc3672-c449-4b92-bb35-f72a65106919%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/c35cccaa-fac6-4732-a5f1-c25d252928dc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
