custom firewall solution
This commit is contained in:
4
roles/backupscript/files/ssh_config
Normal file
4
roles/backupscript/files/ssh_config
Normal file
@ -0,0 +1,4 @@
|
||||
Host backup backup.stargate.internal
|
||||
HostName backup.stargate.internal
|
||||
User backup
|
||||
IdentityFile ~/.ssh/id_rsa
|
@ -11,7 +11,7 @@
|
||||
copy:
|
||||
src: backup-script.service
|
||||
dest: /usr/lib/systemd/system/backup-script.service
|
||||
mode: 644
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
copy:
|
||||
src: backup.target
|
||||
dest: /usr/lib/systemd/system/backup.target
|
||||
mode: 644
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
copy:
|
||||
src: backup.timer
|
||||
dest: /usr/lib/systemd/system/backup.timer
|
||||
mode: 644
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
@ -49,3 +49,11 @@
|
||||
ansible.builtin.systemd:
|
||||
enabled: yes
|
||||
name: backup.timer
|
||||
|
||||
- name: Copy ssh config
|
||||
copy:
|
||||
src: ssh_config
|
||||
dest: /root/.ssh/config
|
||||
mode: 0600
|
||||
owner: root
|
||||
group: root
|
||||
|
@ -3,6 +3,6 @@
|
||||
|
||||
{{backup.prearecommand}}
|
||||
|
||||
time ( rsync -azP --delete {{backup.folder}} backup@192.168.69.26:/mnt/backupstore/{{servicename}}/staging )
|
||||
time ( rsync -azP --delete {{backup.folder}} backup@backup.stargate.internal:/mnt/backupstore/{{servicename}}/staging )
|
||||
|
||||
time ( ssh backup@backup.stargate.internal 'tar -zcvf /mnt/backupstore/{{servicename}}/{{servicename}}-$(date +"%Y-%m-%d").tar.gz -C /mnt/backupstore/{{servicename}}/staging' )
|
||||
time ( ssh backup@backup.stargate.internal 'tar -zcvf /mnt/backupstore/{{servicename}}/{{servicename}}-$(date +"%Y-%m-%d").tar.gz -C /mnt/backupstore/{{servicename}}/staging {{backup.tarfolder}}' )
|
||||
|
Reference in New Issue
Block a user