Defined Type: restic::repository

Defined in:
manifests/repository.pp

Overview

This function manages a Restic backup repository. Currently, only local repositories are supported.

Parameters:

path        - The path to the repository.
ensure      - Either present or removed.
type        - The type of repository to create.

Parameters:

  • password (String)
  • path (String) (defaults to: $title)
  • ensure (Enum['present', 'absent']) (defaults to: 'present')
  • type (Enum['local']) (defaults to: 'local')


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'manifests/repository.pp', line 11

define restic::repository (
  String                    $password,
  String                    $path = $title,
  Enum['present', 'absent'] $ensure = 'present',
  Enum['local']             $type = 'local',
) {
  exec { "init restic respository ${title}":
    command     => "restic init --repo ${path}",
    path        => '/usr/bin:/usr/sbin:/bin:/sbin',
    environment => ["RESTIC_PASSWORD=${password}"],
    creates     => "${path}/config",
    user        => $restic::user,
    group       => $restic::group,
  }
}