omidshj 2025-02-10 13:45:21 +03:30
parent 512627a2fb
commit bff7bd2889
1 changed files with 6 additions and 6 deletions

View File

@ -3,11 +3,7 @@
become: yes
tasks:
- name: Process each item
include_tasks: self
loop: "{{ buckets }}"
loop_control:
loop_var: item
- block:
block:
- name: Export data
command: "s3cmd sync --preserve --config {{ config }} s3://{{ item }} {{ backup_dir }}"
- name: Create tar archive
@ -28,4 +24,8 @@
- name: Delete backed-up files
file:
path: "{{ backup_dir }}/{{server}}-{{service}}-{{ item }}.tar.gz"
state: absent
state: absent
when: item is defined
loop: '{{ buckets }}'
loop_control:
loop_var: item