Compare binary files

Hi, I wish to compare between 2 binary files.

action: copy src = {{srcLocation}} dest={{destLocation}}

–check --diff.

This works well if the 2 binaries are of different sizes. If they are of the same sizes but has different content, ansible shows it as ok, meaning no diff between the 2 files.

Is ansible able to compare two different binary files when they have the same file size?

Thank you.

–diff is really only usable for basic things.

I would register a checksum instead.

Thank you for the reply.

Can you guide me on the usage of checksum? i am unable to find much documentation on checksum.

I would look up the “register” keyword in Ansible and just call md5.

http://www.ansibleworks.com/docs/playbooks2.html#register-variables