# Recursive copy does not support --diff, right? (neither does synchronize; Ansible 1.5)

**URL:** <https://forum.ansible.com/t/recursive-copy-does-not-support-diff-right-neither-does-synchronize-ansible-1-5/14706>\
**Category:** Ansible Project\
**Created:** [March 5, 2014, 1:06pm UTC](https://forum.ansible.com/t/recursive-copy-does-not-support-diff-right-neither-does-synchronize-ansible-1-5/14706 "2014-03-05T13:06:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jakub\_Holy](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@Jakub\_Holy](https://forum.ansible.com/u/Jakub_Holy)\
**Post date:** [March 5, 2014, 1:06pm UTC](https://forum.ansible.com/t/recursive-copy-does-not-support-diff-right-neither-does-synchronize-ansible-1-5/14706/1 "2014-03-05T13:06:49Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [March 6, 2014, 5:11pm UTC](https://forum.ansible.com/t/recursive-copy-does-not-support-diff-right-neither-does-synchronize-ansible-1-5/14706/2 "2014-03-06T17:11:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jakub\_Holy](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@Jakub\_Holy](https://forum.ansible.com/u/Jakub_Holy)\
**Post date:** [March 7, 2014, 8:56am UTC](https://forum.ansible.com/t/recursive-copy-does-not-support-diff-right-neither-does-synchronize-ansible-1-5/14706/3 "2014-03-07T08:56:09Z")

</div>

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](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
