This commit is contained in:
David Rotermund 2024-04-18 17:19:46 +02:00
parent eea626474b
commit a11e63ef74

View file

@ -16,12 +16,12 @@
- name: delete old file - name: delete old file
ansible.builtin.file: ansible.builtin.file:
path: "/docker_backup/docker_volume_{{ ansible_hostname }}.tgz" path: "/docker_backup/dns_{{ ansible_hostname }}.tgz"
state: "absent" state: "absent"
- name: create archive - name: create archive
community.general.archive: community.general.archive:
dest: "/docker_backup/docker_volume_{{ ansible_hostname }}.tgz" dest: "/docker_backup/dns_{{ ansible_hostname }}.tgz"
path: "/var/lib/docker/volumes" path: "/var/lib/docker/volumes"
owner: "ansibleuser" owner: "ansibleuser"
@ -33,6 +33,6 @@
line: "root ALL=(ansibleuser) NOPASSWD: ALL" line: "root ALL=(ansibleuser) NOPASSWD: ALL"
- name: scp file into safety - name: scp file into safety
ansible.builtin.shell: 'scp -o "StrictHostKeyChecking accept-new" /docker_backup/docker_volume_{{ ansible_hostname }}.tgz ansibleuser@10.10.0.2:/home/backup_ansible/' ansible.builtin.shell: 'scp -o "StrictHostKeyChecking accept-new" /docker_backup/dns_{{ ansible_hostname }}.tgz ansibleuser@10.10.0.2:/home/backup_ansible/'
become: false become: false