Your problem is in the way you are using the content argument.  Your string
does not include a trailing newline, and when you run dpkg-reconfigure to
update the timezone, dpkg-reconfigure will notice that there is no trailing
newline and "fix it".  So every time your task runs, you are removing the
trailing newline that dpkg-reconfigure adds to that file.

There is some discussion about this at
https://github.com/ansible/ansible/issues/5715

On Fri, Jan 23, 2015 at 5:00 AM, Christian Loos <[email protected]> wrote:

> Hi,
>
> if i run a task with this:
> copy: dest=/etc/timezone content="Europe/Berlin" owner=root group=root
> mode=0644
> it reports on every run changes.
>
> Verbose output of two runs:
> changed: [xxx] => {"changed": true, "checksum":
> "d34f419876c03cf85365d9102477a4f5791451ae", "dest": "/etc/timezone", "gid":
> 0, "group": "root", "md5sum": "f047a3577fcd6af23b47814293e293c0", "mode":
> "0644", "owner": "root", "size": 13, "src":
> "/home/xxx/.ansible/tmp/ansible-tmp-1422009942.63-92526854461725/source",
> "state": "file", "uid": 0}
>
> changed: [xxx] => {"changed": true, "checksum":
> "d34f419876c03cf85365d9102477a4f5791451ae", "dest": "/etc/timezone", "gid":
> 0, "group": "root", "md5sum": "f047a3577fcd6af23b47814293e293c0", "mode":
> "0644", "owner": "root", "size": 13, "src":
> "/home/xxx/.ansible/tmp/ansible-tmp-1422009987.9-92475302492184/source",
> "state": "file", "uid": 0}
>
> The md5sum of the transfered content always doesn't match the file content.
>
> Control host: Ubuntu
> Destination Host: Debian
> ansible 1.8.2
>
>
> Chris
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/0a91389c-399d-4ee7-80d4-ca255143881c%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/0a91389c-399d-4ee7-80d4-ca255143881c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v9eQSnY0JATw-Lo5KbiJ%3D7-1OpxdUsbXujPWp3dcBh%2B%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to