copy module: how do I copy a file only if it doesn't exist?

I need to create some files, only if they don’t already exist. (DNS zone files). Once they are created, they will be managed by the application (bind9 doing dynamic updates), but they need to be copied or templated in the first place for bind to find them.

What’s the best way to achieve this?

Hi Alex,

When you say only if they don’t exist, do you mean to transfer them to the remote only if they don’t already exist on the remote?

This should be the ‘force=no’ parameter on the copy module, the generated docs are wrongish (borrowed from the file module) and I need to correct them.

Ah-ha.

Yes, that is exactly what I need, thanks. And yes, I've been confused by the documentation of the copy module...

Thanks for your quick response.