How to debug 'changed' files from template module?

Dear all,

I sometimes see files being reported as changed, although the contents
(apart from the ansible_managed) have not changed. The permissions are
the same.

I thought that in these cases, where only the ansible_managed line has
changed, the file would stay the same. I get this behaviour a lot with
other files, and I do not know why.

How to debug this? I am already running my playbook with -v.

Johannes

There's nothing special about ansible_managed, it's just a var like any other.
If you change the contents of a file, handlers will fire.