# How does Ansible determine that a file has changed ?

**URL:** <https://forum.ansible.com/t/how-does-ansible-determine-that-a-file-has-changed/17256>\
**Category:** Ansible Project\
**Created:** [January 14, 2015, 1:18am UTC](https://forum.ansible.com/t/how-does-ansible-determine-that-a-file-has-changed/17256 "2015-01-14T01:18:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Micky](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@Micky](https://forum.ansible.com/u/Micky)\
**Post date:** [January 14, 2015, 1:18am UTC](https://forum.ansible.com/t/how-does-ansible-determine-that-a-file-has-changed/17256/1 "2015-01-14T01:18:11Z")

</div>

Hi,

A rather basic query. How does Ansible determine that a file has changed on the target ? The copy module’s ‘force’ option documentations reads as follows :-

_“default is `yes`, which will replace the remote file when contents are different than the source”_

How does Ansible determine that the file contents are different ?

\_Micky

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 14, 2015, 12:37pm UTC](https://forum.ansible.com/t/how-does-ansible-determine-that-a-file-has-changed/17256/2 "2015-01-14T12:37:31Z")

</div>

ansible does a checksum on the files, if it does not match the files  
are different.
