39 lines
815 B
YAML
Executable File
39 lines
815 B
YAML
Executable File
---
|
|
- name: install requirements for backup system
|
|
apt:
|
|
update_cache: yes
|
|
state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}"
|
|
install_recommends: yes
|
|
pkg:
|
|
- borgbackup
|
|
|
|
- name: setup backup location
|
|
file:
|
|
state: directory
|
|
path: "{{ backup_root }}"
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "0755"
|
|
|
|
- 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: "0777"
|
|
|
|
- include_tasks: master.yml
|
|
when: not backup_client
|
|
|
|
- include_tasks: client.yml
|
|
when: backup_client
|