copy module ignores --check flag for file params when md5sums are the same -- Not Cool!

I am using ansible 1.7.2 on RedHat

Note that I am super happy that I was doing something somewhat innocuous; however, this did just make a large number of changes across 600+ hosts… not a very cool behavior… this did not exist in 1.5, which is the version from which i upgraded.

thanks in advance…

relevant play:

roles/common/tasks/main.yml

Can you please be explicit about what the “not a very cool behavior” is ?

I’m having trouble parsing your intent from the above.

Thanks!

Can you please be explicit about what the “not a very cool behavior” is ?

no problem. what the example below shows is that when using the copy module with file parameters (e.g. mode, owner, group) that the --check flag works if and only if the src and dest checksums do not match. When they are equal, ansible happily makes the file parameter changes, regardless of --check usage. I updated to 1.7.2 from 1.5 and this behavior did not exist before. In 1.5, if the files were the same and the mode was different (for example), ansible would flag it as changed, but not make the change when using the --check flag. This, in my opinion, is the correct and expected behavior.

Thanks!

following up on this… is this a bug or an expected behaviour?

It is a bug. However, I think there have been several fixes to the
file/copy module regarding check mode recently. For instance:
https://github.com/ansible/ansible/issues/8639

I've just tested a very simple copy module playbook and it incorrectly
changed the mode with ansible-1.7.2 but did not set the mode with the
code in the ansible devel branch. So I believe this has been fixed.
If you want to confirm with your more complex case you could check out
the repository from https://github.com/ansible/ansible and give it a
try.

-Toshio

i am unable to pull the development branch at work. if i have a chance i will pull it down and test it at home. it is my hope to get involved with this project because i think it is awesome; however, there are still a few hurdles (e.g. no real spare time right now :slight_smile: ).

anyhow… let me know if you want me to put it up as a bug in github. if not, then i will just set a reminder to look at this sometime in the future.

thanks!