init commit borg

This commit is contained in:
lhahn committed 2024-06-23 18:51:36 +02:00
1 parent 36ed650628
commit 4c6cc1e6da
14 files changed
+123 -296

No files matched your search

+28 -19
View File
@@ -1,34 +1,43 @@
---
# Basics
- name: install requirements for backup system
apt:
update_cache: yes
state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}"
install_recommends: yes
pkg:
- rsync
- borgbackup
- name: setup storage folders for backup
- name: setup backup location
file:
state: directory
path: "{{ dir.value.path }}"
path: "{{ backup_root }}"
owner: "root"
group: "root"
mode: "0755"
- name: Setup required groups of users
group:
name: "{{ backup_group }}"
state: present
- name: generate backup user
user:
name: "{{ backup_owner }}"
group: "{{ backup_group }}"
comment: backup user
shell: /sbin/nologin
home: "{{ backup_home }}"
- name: setup backup storage
file:
state: directory
path: "{{ backup_storage }}"
owner: "{{ backup_owner }}"
group: "{{ backup_group }}"
mode: "{{ backup_permission }}"
with_dict: "{{ backup_storage }}"
loop_control:
loop_var: dir
label: "{{ dir.key }}"
mode: "0777"
- name: setup conf folder
file:
state: directory
path: "{{ backup_folder }}/conf"
- include_tasks: master.yml
when: not backup_client
- name: setup client backup structure
include_tasks: client.yml
- include_tasks: client.yml
when: backup_client
- name: setup server backup structure
include_tasks: server.yml
when: not backup_client