I've got a task I'm trying to run, where a file gets copied if that file has changed. It's a local file (though it's copied from a remote to a local destination first) and I want to copy it to several hosts. When I run the task it bombs with
Unsupported parameters for (copy) module: when. Supported parameters include: attributes,backup,content,delimiter,dest,directory_mode,follow,force,group,mode,original_basename,owner,regexp,remote_src,selevel,serole,setype,seuser,src,unsafe_writes,validate
Here's the part of the play that's relevant:
tasks:
- name: get stat of files
stat:
path: files/WHITELIST-squash.txt
register: whitelist
- name: Push to mail proxies
copy:
src: files/WHITELIST-squash.txt
dest: /root/bin/postfixFindSpammers.ignore
backup: yes
when: whitelist.stat.changed
The problem is, when I've googled the copy module, other sources are saying 'when' can be used with it. The documentation doesn't, so what's the bloody deal here? Can or can you not use when with copy? To me, this seems silly to have that option. I've noticed that you can use when with a template, which is nothing but a copy with some dynamic editing thrown in.
I don't get it. Any ideas?