Forge Home

restic

Puppet module to configure Restic systemd service to backup/forget/restore data.

7,025 downloads

1,853 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 2.6.1 (latest)
  • 2.6.0
  • 2.5.2
  • 2.5.1
  • 2.5.0
  • 2.4.0
  • 2.3.0
  • 2.2.4
  • 2.2.3
  • 2.2.2
  • 2.2.1
  • 2.2.0
  • 2.1.0
  • 2.0.3
  • 2.0.2
  • 2.0.1
  • 2.0.0
  • 1.0.0
released Apr 28th 2023
This version is compatible with:
  • Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
  • Puppet >= 6.0.0 < 8.0.0

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'syseleven-restic', '2.6.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add syseleven-restic
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install syseleven-restic --version 2.6.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

syseleven/restic — version 2.6.1 Apr 28th 2023

Overview

This module manages Restic repositories via Puppet with systemd service and timer units. See: https://restic.net/

!!! This module has only been tested on Ubuntu 20.04 !!!

Features

  • Backup
  • Forget
  • Restore

Module Description

By default $enable_backup is true. By default $enable_forget and $enable_restore are false.

For each repository you enable a systemd service will be installed. To trigger the service automatically you have to set a systemd timer value ($backup_timer, $forget_timer, $restore_timer).

By default no timer is set.

If you don't enable any feature the Restic repository will only be initialized.

Usage

Initialize Restic repository only on an S3 Bucket

---
classes:
  - restic

restic::repositories:
  some_repo1:
    enable_backup: false
    id: a3f5173hdsks934
    key: y7ahajhsd3uzasa
    password: yxcvasdf1234
    host: some.host.name
    bucket: bucket_name/backup1

Add a simple backup

Configure a repository and backup 2 directories

---
classes:
  - restic

restic::repositories:
  some_repo2:
    backup_path:
      - /full/path/1
      - /some/other/path
    backup_timer: Mon..Sun 20:00:00
    bucket: bucket_name/backup1
    host: some.host.name
    id: a3f5173hdsks934
    key: y7ahajhsd3uzasa
    password: yxcvasdf1234

Add cleanup via the forget service

restic::repositories:
  some_repo2:
    ...
    enable_forget: true
    forget_timer: Mon..Sun 23:00:00

Add two backups on the same S3 Bucket

---
classes:
  - restic

restic::id: a3f5173hdsks934
restic::key: y7ahajhsd3uzasa
restic::host: some.host.name
restic::repositories:
  some_repo3:
    backup_path:
      - /full/path/1
      - /some/other/path
    bucket: bucket_name/backup1
    password: yxcvasdf1234
  some_repo4:
    backup_path: /other/path
    bucket: bucket_name/backup2
    password: yxcvasd3456f1234

Add two backups on the different S3 Buckets with different access data on the same host

---
classes:
  - restic

restic::host: some.host.name
restic::repositories:
  some_repo1:
    backup_path:
      - /full/path/1
      - /some/other/path
    bucket: bucket_name1/backup1
    id: a3f5173hdsks934
    key: y7ahajhsd3uzasa
    password: yxcvasdf1234
  some_repo2:
    backup_path: /other/path
    bucket: bucket_name2/backup2
    id: y7ahajhsd3uzasa
    key: a3f5173hdsks934
    password: yxcvasd3456f1234

Add two restore only job from the same S3 Repository

---
classes:
  - restic

restic::enable_backup: false
restic::enable_restore: true
restic::id: a3f5173hdsks934
restic::key: y7ahajhsd3uzasa
restic::host: some.host.name
restic::repositories:
  some_repo3:
    restore_path: /full/path/restore
    bucket: bucket_name/backup1
    password: yxcvasdf1234
  some_repo4:
    backup_path: /other/path
    bucket: bucket_name/backup2
    password: yxcvasd3456f1234

Other exmaples

Can be found in EXAMPLES.

Development

If you'd like to contribute, please see CONTRIBUTING.