mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2025-05-24 01:17:15 +02:00
38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
---
|
|
- name: Setup backup environment
|
|
tags:
|
|
- install_backup
|
|
when:
|
|
- install_backup is not defined or install_backup
|
|
- backup_create_local_user is not defined or backup_create_local_user
|
|
block:
|
|
- name: Add local backup group
|
|
ansible.builtin.group:
|
|
name: "{{ borgbackup_group }}"
|
|
state: present
|
|
|
|
- name: Add local backup user
|
|
ansible.builtin.user:
|
|
name: "{{ borgbackup_user }}"
|
|
shell: "/bin/bash"
|
|
groups: "{{ borgbackup_group }}"
|
|
comment: "Backup User Account"
|
|
append: true
|
|
|
|
- name: Add sudo users
|
|
community.general.sudoers:
|
|
name: "backup"
|
|
state: present
|
|
user: "{{ borgbackup_user }}"
|
|
nopassword: true
|
|
commands:
|
|
- "/opt/borgmatic/bin/borg"
|
|
- "/usr/local/bin/borgmatic -C -p -c /etc/borgmatic/{{ borgmatic_config_name }}"
|
|
- "/usr/local/bin/borgmatic -k -c /etc/borgmatic/{{ borgmatic_config_name }}"
|
|
- "/usr/local/bin/borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }}"
|
|
|
|
- name: Install Links to borg and borgmatic
|
|
ansible.builtin.include_tasks:
|
|
file: noauto_create_links_and_install_helperscripts.yml
|
|
...
|