aboutsummaryrefslogtreecommitdiff
path: root/shutdown.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'shutdown.yaml')
-rw-r--r--shutdown.yaml17
1 files changed, 17 insertions, 0 deletions
diff --git a/shutdown.yaml b/shutdown.yaml
new file mode 100644
index 0000000..efda810
--- /dev/null
+++ b/shutdown.yaml
@@ -0,0 +1,17 @@
+---
+- hosts: all
+ any_errors_fatal: true
+ tasks:
+ - name: Copy files for performing the backup
+ copy: src={{ item.src }} dest={{ item.dest }} mode={{ item.mode }}
+ with_items:
+ - { src: './generated/create-backup.sh', dest: '/home/vps/create-backup.sh', mode: '500' }
+ - { src: './secrets/borg/borg-remote.pub', dest: '/root/.ssh/id_rsa.pub', mode: '400' }
+ - { src: './secrets/borg/borg-remote', dest: '/root/.ssh/id_rsa', mode: '400' }
+ - { src: './secrets/borg/known-hosts.txt', dest: '/root/.ssh/known_hosts', mode: '400' }
+ - name: Stop docker-compose
+ docker_service:
+ project_src: /home/vps/
+ state: absent
+ - name: Create a borg backup of the volume
+ shell: /home/vps/create-backup.sh