2021-03-11 20:08:41 +01:00
|
|
|
---
|
|
|
|
- name: Install borg
|
|
|
|
apt:
|
|
|
|
name: borgbackup
|
2021-03-15 07:51:48 +01:00
|
|
|
state: present
|
2021-03-11 20:08:41 +01:00
|
|
|
update_cache: true
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
|
|
|
|
|
|
|
- name: Create a local group for borg
|
|
|
|
become: true
|
|
|
|
group:
|
|
|
|
name: "{{ borg_server_group }}"
|
|
|
|
system: true
|
|
|
|
|
|
|
|
- name: Create a local user for borg
|
|
|
|
become: true
|
|
|
|
user:
|
|
|
|
home: "{{ borg_home_dir }}"
|
|
|
|
create_home: true
|
|
|
|
comment: Local user for borgbackup server
|
|
|
|
name: "{{ borg_server_user }}"
|
|
|
|
group: "{{ borg_server_group }}"
|
|
|
|
system: true
|
|
|
|
# Does not constitute a valid hash, preventing from login via password
|
|
|
|
password: "*"
|
|
|
|
update_password: always
|
|
|
|
|
|
|
|
- name: Create backup directory
|
|
|
|
become: true
|
|
|
|
file:
|
|
|
|
path: "{{ borg_server_backups_dir }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ borg_server_user }}"
|
|
|
|
group: "{{ borg_server_group }}"
|
2021-03-14 18:29:33 +01:00
|
|
|
mode: u=rwx,g=,o=
|
2021-03-11 20:08:41 +01:00
|
|
|
...
|