Is there any nice way of comparing a file on a host with a local file in Ansible? I don’t just want to know if they are different but also how they differ. Something like the output of the Linux diff command. The only way I can think of is first copying the file from the host to local and then using Linux diff through the command module, but I would prefer to do it without having to create a local copy of the file. Any ideas?
Any way of making this work for directories? So that differences in each file in the directory and subdirectories are displayed. And to display if one file only exists in one directory or the other?