I still don’t understand why exactly there is no directory copying functionality available in ansible. Such a buzzkill. Am i missing something here? The work arounds are just over heads.
You are free to look at the code yourself and determine why.
https://github.com/ansible/ansible/blob/devel/library/files/copy
There was a synchronization module that was found to have problems. You can check out the merging commit here
https://github.com/ansible/ansible/commit/aeb8649da54b880b45c92a0f0a227cf360184099
Patrick,
I’m not sure I understand your comment – there’s nothing about the code that says recursive copy support couldn’t be implemented at some point.
Until then, shell out to rsync.
Rsync shouldn’t be hard for anyone, let me know what problems you are having.
Thanks!
–Michael
That was my point, but I should have made that more clear. My apologies.
I made a module using **distutils.dir_util.copy_tree** which recursively copy directories including the data. If anyone else need it i can improve and send in the pull request?
It probably shouldn’t be a new module, but a patch on top of the copy module if, say, recurse=yes is specified.
i’ll look into it tonight. Was having trouble with md5sum for directories so separated it for time being. Will have to look
my current workaround is 2 copy tasks with the following:
with_pipe: find {{path}} -type d
with_pipe: find {{path}} -type f
first one creates directory tree structure, 2nd one copies files.