52 lines
1.1 KiB
YAML
Executable File
52 lines
1.1 KiB
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: 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: /bin/bash
|
|
home: "{{ backup_home }}"
|
|
|
|
- name: Setup ssh folder
|
|
file:
|
|
state: directory
|
|
path: "{{ backup_home }}/.ssh"
|
|
owner: "{{ backup_owner }}"
|
|
group: "{{ backup_group }}"
|
|
mode: "0700"
|
|
|
|
- name: setup backup storage
|
|
file:
|
|
state: directory
|
|
path: "{{ backup_storage }}"
|
|
owner: "{{ backup_owner }}"
|
|
group: "{{ backup_group }}"
|
|
mode: "0777"
|
|
|
|
- include_tasks: server.yml
|
|
when: not backup_client
|
|
|
|
- include_tasks: client.yml
|
|
when: backup_client
|