|
|
|
@ -57,6 +57,13 @@
|
|
|
|
permission: "{{ docker_backup_aws_s3_permissions }}"
|
|
|
|
permission: "{{ docker_backup_aws_s3_permissions }}"
|
|
|
|
with_items: "{{ volume_mounts }}"
|
|
|
|
with_items: "{{ volume_mounts }}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# delete local backups if we are not keeping them.
|
|
|
|
|
|
|
|
- name: Delete local backups.
|
|
|
|
|
|
|
|
file:
|
|
|
|
|
|
|
|
path: "{{ docker_backup_host_backup_directory }}/{{ item.Name }}-{{ backup_time }}.tar.gz"
|
|
|
|
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
when: not docker_backup_keep_local
|
|
|
|
|
|
|
|
with_items: "{{ volume_mounts }}"
|
|
|
|
|
|
|
|
|
|
|
|
# try and find latest volume based on the name.
|
|
|
|
# try and find latest volume based on the name.
|
|
|
|
- name: Fetch Volumes From S3.
|
|
|
|
- name: Fetch Volumes From S3.
|
|
|
|
@ -77,7 +84,7 @@
|
|
|
|
ansible.builtin.set_fact:
|
|
|
|
ansible.builtin.set_fact:
|
|
|
|
s3_keys_to_delete: "{{ s3_list_outputs.results | map(attribute='s3_keys') | keep_last(docker_backup_retain_count) | flatten }}"
|
|
|
|
s3_keys_to_delete: "{{ s3_list_outputs.results | map(attribute='s3_keys') | keep_last(docker_backup_retain_count) | flatten }}"
|
|
|
|
|
|
|
|
|
|
|
|
- name: Delete old backups.
|
|
|
|
- name: Delete old s3 backups.
|
|
|
|
when: docker_backup_retain_count is defined
|
|
|
|
when: docker_backup_retain_count is defined
|
|
|
|
amazon.aws.aws_s3:
|
|
|
|
amazon.aws.aws_s3:
|
|
|
|
bucket: "{{ docker_backup_aws_s3_bucket }}"
|
|
|
|
bucket: "{{ docker_backup_aws_s3_bucket }}"
|
|
|
|
|