Replace backup script with autorestic

This commit is contained in:
Tobias Reisinger 2024-10-06 01:59:46 +02:00
commit ed51a86935
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
17 changed files with 188 additions and 232 deletions

View file

@ -0,0 +1,23 @@
---
- name: Set hooks path
ansible.builtin.set_fact:
hooks_path: "{{ (service_path, 'hooks') | path_join }}"
- name: Create hooks directory
ansible.builtin.file:
path: "{{ hooks_path }}"
state: directory
mode: "0755"
- name: Copy the hooks
ansible.builtin.copy:
src: "{{ item }}"
dest: "{{ hooks_path }}"
mode: "0755"
with_fileglob:
- "hooks/*"
- name: Create the from directories
ansible.builtin.file:
path: "{{ ('/opt/services/_backup', item | basename) | path_join }}"
state: directory
mode: "0755"
with_fileglob:
- "hooks/*"