# Role: borgmatic

## Description

Installs and configures borgmatic for backups.

https://torsion.org/borgmatic/

## Usage

Using in a playbook:

```yaml
- name: Play
  gather_facts: true
  gather_subset:
    - distribution
  hosts:
    - all
  roles:
    - samuliy.ansible.borgmatic
  vars:
    ...
```

### Vars

`borgmatic_monitor_loki_url`:

Loki URL where to post Borgmatic logs.

`borgmatic_monitor_uptime_kuma_url`:

Uptime-Kuma URL to post Borgmatic status.

`borgmatic_borg_repository_ssh_private_key`:

SSH private key for the Borg repository.

`borgmatic_borg_repository_ssh_public_key`:

SSH public key for the Borg repository.

`borgmatic_borg_repository`:

Borg repository object with fields:
- 'passphrase'
- 'path'
- 'label'
Check rest of the fields from templates/etc/borgmatic/config.yaml.j2

`borgmatic_borg_source_directories`:

Source directories to send to backup.

`borgmatic_borg_mysql_databases`:

MySQL databases to backup.

`borgmatic_borg_patterns`:

Backup patterns.

`borgmatic_borg_before_backup`:

Commands to execute before backup.

`borgmatic_borg_after_backup`:

Commands to execute after backup.

`borgmatic_borg_on_error`:

Commands to execute on error.

`borgmatic_systemd_timer_oncalendar`:

OnCalendar value for the systemd timer.

`borgmatic_borg_default_ssh_options`:

Default SSH options.
