diff --git a/playbooks/sync_mailu.yaml b/playbooks/sync_mailu.yaml index ccb014f..5ed3d56 100644 --- a/playbooks/sync_mailu.yaml +++ b/playbooks/sync_mailu.yaml @@ -1,6 +1,8 @@ - hosts: containers name: Stop mailu ignore_unreachable: false + vars: + arch_name: docker_mailu2_data tasks: - name: Start mailu rasp uri: @@ -60,7 +62,7 @@ - name: Create archive #ansible.builtin.shell: 'tar -czf /share/Data/dockers.tar.gz /share/docker_data/{mailu2,webhub,ha} --exclude="/ha/backups/*" --exclude="home-assistant.log*"' - ansible.builtin.shell: 'tar -czf /share/Data/dockers-{{ ansible_date_time.date }}.tar.gz /share/docker_data/mailu2 --exclude="/ha/backups/*" --exclude="home-assistant.log*"' + ansible.builtin.shell: 'tar -czf /share/Data/{{ arch_name }}-{{ ansible_date_time.date }}.tar.gz /share/docker_data/mailu2 --exclude="/ha/backups/*" --exclude="home-assistant.log*"' ignore_errors: yes when: inventory_hostname in groups['nas'] @@ -115,9 +117,9 @@ - 140 - 150 - 132 - + - name: Copy archive - ansible.builtin.shell: 'scp /share/Data/dockers-{{ ansible_date_time.date }}.tar.gz admin@192.168.77.246:/tmp/' + ansible.builtin.shell: 'scp /share/Data/{{ arch_name }}-{{ ansible_date_time.date }}.tar.gz admin@192.168.77.246:/tmp/' when: inventory_hostname in groups['nas'] #- name: Unpack archive @@ -128,7 +130,7 @@ - name: Extract become: yes ansible.builtin.unarchive: - src: /tmp/dockers-{{ ansible_date_time.date }}.tar.gz + src: /tmp/{{ arch_name }}-{{ ansible_date_time.date }}.tar.gz dest: / remote_src: yes when: inventory_hostname in groups['raspberry'] \ No newline at end of file