cloud-backup/tasks/main.yml
2023-08-20 11:12:58 +02:00

34 lines
791 B
YAML
Executable File

---
# 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
- name: setup storage folders for backup
file:
state: directory
path: "{{ dir.value.path }}"
owner: "{{ backup_owner }}"
group: "{{ backup_group }}"
mode: "{{ backup_permission }}"
with_dict: "{{ backup_storage }}"
loop_control:
loop_var: dir
label: "{{ dir.key }}"
- name: setup conf folder
file:
state: directory
path: "{{ backup_folder }}/conf"
- name: setup client backup structure
include_tasks: client.yml
when: backup_client
- name: setup server backup structure
include_tasks: server.yml
when: not backup_client