diff --git a/semaphore.yaml b/semaphore.yaml index 2b9fddb..9907a2d 100644 --- a/semaphore.yaml +++ b/semaphore.yaml @@ -58,5 +58,15 @@ recurse: false register: backup_files loop: "{{ backup_dirs.files }}" + loop_control: + label: "{{ item.path }}" - - debug: var=backup_files + - name: Store the daily backup + copy: + remote_src: true + src: "{{ item.path }}" + dest: "{{ item.path | dirname }}/daily/{{ item.path | basename }}" + with_items: "{{ backup_files.results | map(attribute='files') | list }}" + when: (ansible_date_time.weekday_number != "1" and ansible_date_time.day != "01") + loop_control: + label: "{{ item.path }}"