ansible/ansible — pull request #4426 by mbarrin (2013-10-10 12:02:30+00:00)
Title: Updated s3 module so that force behaves correctly with get and push

Yesterday I submitted this bug report for the s3 module. https://github.com/ansible/ansible/issues/4408

A fix was applied but all it did was change the module to use force by default.

This resulted in objects from s3 being downloaded over multiple runs even if the md5sums were the same. Which is not the ansible way.

The updated version of the script will only download the the file if the md5sum has changed and overwrite/force is set to true. (Which it is by default)

I also updated the put section. It was crashing if the bucket did not exist, as it was attempting to check if the object existed within the bucket object, which was returning NoneType. So now there is a conditional.

Two of the commands were also returning failures if overwrite was set to False. They now return with changed=False.

Lines 343-355 were removed as they were never being reached.