Possibility of copying directorys

Hi, I want to use the copy module to copy the whole content of a directory in a recursiv way to a path on a host.

With copy I get all the time error messages, but then I realized copy is just for single files. Is there any way to help me out?

I didn’t find a module or another way to do it with ansible.

cheers

One of the best ways is to just use "local_action" to invoke rsync.

Copy may support recursive transfer in the near future.

Thank you Michael

Would be great. It will make it pretty easy to install same software on different domains. And if this software available in git-repo just one kid to maintain.

Will try it with local_action by now.

The advantage of a recursive copy is that the status would only be "changed" if it is actually change, while command and shell always return a "changed" status.

Should we file a feature request issue to track this?

local_action is preferred here. A less savoury “hacky” method for if you have a top-level directory full of files (i.e. no deeper) may be to list the contents and register the output, then iterate through via with_items and the copy module. I’ve not actually tried but perhaps it would work?

yes please :slight_smile: