# template module on top of symlink always returns "changed"

**URL:** <https://forum.ansible.com/t/template-module-on-top-of-symlink-always-returns-changed/23871>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [March 3, 2017, 9:10am UTC](https://forum.ansible.com/t/template-module-on-top-of-symlink-always-returns-changed/23871 "2017-03-03T09:10:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ioannis\_Cherouvim](https://avatars.discourse-cdn.com/v4/letter/i/71e660/32.png) [@Ioannis\_Cherouvim](https://forum.ansible.com/u/Ioannis_Cherouvim)\
**Post date:** [March 3, 2017, 9:10am UTC](https://forum.ansible.com/t/template-module-on-top-of-symlink-always-returns-changed/23871/1 "2017-03-03T09:10:23Z")

</div>

Hello

My playbook contains:

`

- name: configure mysql  
template: src=my.cnf.j2 dest=/etc/mysql/my.cnf  
notify:
- restart mysql  
`

In ubuntu 14 /etc/mysql/my.cnf is an actual file.  
In ubuntu 16 /etc/mysql/my.cnf is a symlink to /etc/alternatives/my.cnf.

When it’s a symlink, the template module always outputs a “changed”, even if the actual contents are exactly the same, thus mysql is always restarted.

Is there a way to configure template in a way to not return “changed” when the actual target is behind a symlink?

thanks
