ansible/ansible — pull request #1808 by smoothify (2012-12-31 00:00:48+00:00)
Title: Recursive Copy module

I needed to have a recursive copy function to make keeping track of folders of multiple files, rather than specifiying them individually.

I thought about modifying the copy module to add a recursive parameter, but to avoid introducing unforeseen problems with copy, I cloned it into a new rcopy module for now.

It works exactly the same as copy except it allows directories to be passed in as the src parameter. It recurses through the list of files contained within them and then runs the copy process for each file individually.

I have created both an action_plugin, and a module. The module is unchanged from copy, with the exception of a call to os.makedirs(dest) if the dest parent folder does not exist.

It mimics rsync behaviour with the traling slashes on src:
```python
# A trailing / on a source name means "copy the contents of this directory".
# Without a trailing slash it means "copy the directory".
```
There is also an exclude file mask applied, for which i've added a value to constants.py. This is a comma separated list of filename paths that should be excluded from the upload - typically hidden files like .DS_Store, Thumbs.db, VCS files, etc.

```
rcopy_exclude=.DS_Store,Desktop.ini,._*,Thumbs.db,.git,.git*,.svn

```