Hello,
using Ansible 1.5 and recursively copying a directory, I expect to see detailed diff of the individual changed files when running with “-C --diff” but I only get informed that the top directory has changed. Is that correct? Is there a feature request to make --diff during a recursive copy work as it does for a file copy, i.e. to show diff of each file changed? Are there plan to implement this in the near future?
(It is slightly better with synchronize that uses rsync’s --itemize-changes and at least shows what has hcanged - size, checksum, timestamp, … - but not the diff.)
Thank you!
The diff stuff is really only intended on basic things in the first implementation, the addition made to recursive copy didn’t really feel the need to support the diff mode.
To be honest, if you have more than one system, --diff gets ugly pretty quick. I’ve been tempted to cull it at times – while a great feature that I do appreciate the addition of, it is quite involved in the way it works, so there’s a bit more than usual maintaince cost to it, and this is one of those things.
It’s not really it’s fault, but more of a case of there being a LOT of data.
I’m open to improvements, though I will say that we might be a little hesistant about them due to lots of important magic involved. Copy is pretty mission critical.
Hi Michael,
Thank you for the answer!
Perhaps it would be good to mention the unavailability of diff in recursive copy at http://docs.ansible.com/copy_module.html?
For us diff is quite an important feature because we actually do not have control over our prod environment (contrary to staging) so we want to use Ansible to configure our staging and then to check if the production is different or not. There are no other tools I would know of that are capable of a recursive diff. What I would typically do is run Ansible with -C, without -diff; if there are any changes, I would run it with --diff for a particular node to find out what the hosting company has screwed up.
I have currently worked our this limitation by using copy with with_fileglob for each of the sub(dirs) (fortunately there are only few). But it would be great if Ansible eventually got support for diffs on recursive copies.
Best regards,
Jakub Holy