I have a generic question about ansible, and the way it manages files on target
(managed) systems. They're all Linux systems.
I'm working in an environment where a colleague is running ansible scripts to
manage servers I work with, and I see that every time ansible runs, it updates
date and time stamps on files it is managing, even when the content is already
correct and isn't being changed.
Is this a standard feature of ansible and the way it does configuration
management, or does it suggest that there's something incorrect or at least
inefficient about the way it's being used here?
I'm really not familiar with ansible myself, but I have used puppet in the
past, and that didn't do this - if a file was already correct it did not get
touched.
No. It's not a standard feature of Ansible. Just the opposite, in
most cases the goal is to make a playbook idempotent. There should be
no changes reported when running a playbook repeatedly.
Try to find out which Ansible module(s) is/are causing the troubles.
The task should report 'changed: true'. For example, the task below
(running at localhost only)