So, I am trying to synchronize files to Amazon S3 using the s3_sync module. The playbook works properly, with the exception of the file_change_strategy parameter date_size. It seems to ignore files with same size, but different (more recent) dates. Here is my playbook:
---
- name: backup
hosts: all
gather_facts: no
become: yes
- name: sync all files to Amazon S3
vars:
ansible_python_interpreter: /usr/bin/python3
s3_sync:
aws_access_key: "{{ key }}"
aws_secret_key: "{{ secret }}"
region: us-east-1
bucket: "{{ s3bucket }}"
file_root: "/path/{{ mylocation }}/folder"
key_prefix: "{{ keyprefix }}/"
file_change_strategy: date_size
permission: bucket-owner-full-control
exclude: "*.txt" # sync all files except for txt
I have verified the file(s) using touch/stat to make sure modified dates are newer than the file stored on Amazon S3.
The file(s) are created by a backup process. Since the source file has not changed, the resulting size of the backup file(s) is the same. The timestamp(s) are updated after each backup.
I have also removed the exclude parameter to see if that had any impact on the results. There was no change.
When I alter the file_change_strategy to "force", the newer file uploads to Amazon S3.
Bug? or am I missing something???