template module on top of symlink always returns "changed"

11 views
Skip to first unread message

Ioannis Cherouvim

unread,
Mar 3, 2017, 4:10:23 AM3/3/17
to Ansible Project
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
Reply all
Reply to author
Forward
0 new messages