# copy module: task is getting marked as 'changed' on every run

**URL:** <https://forum.ansible.com/t/copy-module-task-is-getting-marked-as-changed-on-every-run/14534>\
**Category:** Ansible Project\
**Created:** [February 10, 2014, 4:35pm UTC](https://forum.ansible.com/t/copy-module-task-is-getting-marked-as-changed-on-every-run/14534 "2014-02-10T16:35:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hernandes\_Sousa](https://avatars.discourse-cdn.com/v4/letter/h/eb8c5e/32.png) [@Hernandes\_Sousa](https://forum.ansible.com/u/Hernandes_Sousa)\
**Post date:** [February 10, 2014, 4:35pm UTC](https://forum.ansible.com/t/copy-module-task-is-getting-marked-as-changed-on-every-run/14534/1 "2014-02-10T16:35:40Z")

</div>

Hi,

I have this task:

- name: set Location for timezone  
copy: src=timezone dest=/etc/timezone  
owner=root  
group=root  
mode=0644  
notify:
- update timezone

My problem is it is updating the file on every run even though the file has not changed:

TASK: [common | set timezone variables] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [host1]  
changed: [host2]  
changed: [host3]

NOTIFIED: [common | update timezone] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [host1]  
changed: [host2]  
changed: [host3]

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
host1 : ok=6 changed=2 unreachable=0 failed=0  
host2 : ok=6 changed=2 unreachable=0 failed=0  
host3 : ok=6 changed=2 unreachable=0 failed=0

How do I get it to change the file only if it has changed? I tried it with both 1.5 and 1.4.4 versions

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [February 10, 2014, 5:09pm UTC](https://forum.ansible.com/t/copy-module-task-is-getting-marked-as-changed-on-every-run/14534/2 "2014-02-10T17:09:08Z")

</div>

Likely your ‘update timezone’ handler, which I will guess is calling dpkg-reconfigure, causes the file to change slightly.

Try running with --diff. Make sure your ‘timezone’ file has a trailing new line. Also maybe show us your handler and the contents of your timezone file.

The following discussion may also be of benefit:

[https://github.com/ansible/ansible/issues/5715](https://github.com/ansible/ansible/issues/5715)

---

<div class="post-metadata">

**Author:** ![Hernandes\_Sousa](https://avatars.discourse-cdn.com/v4/letter/h/eb8c5e/32.png) [@Hernandes\_Sousa](https://forum.ansible.com/u/Hernandes_Sousa)\
**Post date:** [February 10, 2014, 5:20pm UTC](https://forum.ansible.com/t/copy-module-task-is-getting-marked-as-changed-on-every-run/14534/3 "2014-02-10T17:20:56Z")

</div>

That was exactly the case thank you very much for your prompt response!
