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