Update
This commit is contained in:
parent
a11e63ef74
commit
62d4018b26
1 changed files with 5 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- name: backup docker volume
|
||||
- name: backup dns
|
||||
hosts: all
|
||||
become: true
|
||||
gather_facts: true
|
||||
|
@ -8,7 +8,7 @@
|
|||
|
||||
- name: make backup folder
|
||||
ansible.builtin.file:
|
||||
path: "/docker_backup/"
|
||||
path: "/dns_backup/"
|
||||
owner: "ansibleuser"
|
||||
group: "ansibleuser"
|
||||
mode: '0700'
|
||||
|
@ -16,12 +16,12 @@
|
|||
|
||||
- name: delete old file
|
||||
ansible.builtin.file:
|
||||
path: "/docker_backup/dns_{{ ansible_hostname }}.tgz"
|
||||
path: "/dns_backup/dns_{{ ansible_hostname }}.tgz"
|
||||
state: "absent"
|
||||
|
||||
- name: create archive
|
||||
community.general.archive:
|
||||
dest: "/docker_backup/dns_{{ ansible_hostname }}.tgz"
|
||||
dest: "/dns_backup/dns_{{ ansible_hostname }}.tgz"
|
||||
path: "/var/lib/docker/volumes"
|
||||
owner: "ansibleuser"
|
||||
|
||||
|
@ -33,6 +33,6 @@
|
|||
line: "root ALL=(ansibleuser) NOPASSWD: ALL"
|
||||
|
||||
- name: scp file into safety
|
||||
ansible.builtin.shell: 'scp -o "StrictHostKeyChecking accept-new" /docker_backup/dns_{{ ansible_hostname }}.tgz ansibleuser@10.10.0.2:/home/backup_ansible/'
|
||||
ansible.builtin.shell: 'scp -o "StrictHostKeyChecking accept-new" /dns_backup/dns_{{ ansible_hostname }}.tgz ansibleuser@10.10.0.2:/home/backup_ansible/'
|
||||
become: false
|
||||
|
||||
|
|
Loading…
Reference in a new issue