# Role: restic

## Description

Installs and configures restic for backups.

https://restic.net/

## Usage

Using in a playbook:

```yaml
- name: Play
  hosts:
    - all
  roles:
    - samuliy.ansible.restic
  vars:
    ...
```

### Vars

`restic_repository`:

Path to the restic repository.

`restic_password`:

RESTIC_PASSWORD value.

`restic_password_file`:

RESTIC_PASSWORD_FILE value.

`restic_aws_access_key_id`:

AWS_ACCESS_KEY_ID value.

`restic_aws_secret_access_key`:

AWS_SECRET_ACCESS_KEY value.

`restic_systemd_timer_oncalendar`:

OnCalendar value for the systemd timer.

`restic_user`:

User to run restic as.

`restic_backup_directories`:

Directories to backup with restic.

`restic_backup_exclude`:

Patterns to exclude from backup.

`restic_backup_commands`:

Commands to run, output to backup with restic.

The variables is a list with items with fields:

- 'cmd' - command to run
- 'output_filename' - filename for the output

`restic_bin`:

Path to the restic executable.

`restic_backup_args`:

Additional args for restic backup.

`restic_check_args`:

Additional args for restic check.

`restic_forget_args`:

Additional args for restic forget.

`restic_prune_args`:

Additional args for restic prune.

`restic_before_backup`:

List of commands to run before backup.

`restic_after_backup`:

List of commands to run after backup.

`restic_on_error`:

List of commands to run on error.

`restic_forget_keep`:

Counts and durations for keeping backups for restic forget command.

Dict that maps to the respective '--keep-*' parameters of the restic forget command.
