cheasles-restic

Puppet module for Restic


License
Apache-2.0
Install
puppet module install cheasles-restic --version 1.0.1

Documentation

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with puppet-restic
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Overview

This module manages Restic backups via Puppet.

Module Description

This module provides multiple Puppet classes that can be used to manage Restic repositories and backups.

Setup

What puppet-restic affects

  • Installs the Restic package using the system package manager.
  • Creates a new user/group to own backup repositories.
  • Creates SystemD services and timers to automatically backup specified data on a set schedule.

Setup Requirements

This module uses the system package manager to install Restic. If your package manager doesn't have a Restic package then this probably won't work.

Beginning with puppet-restic

To get started, simply include the restic class as follows:

include ::restic

You then need to define a base repository to backup to. You can do this in Puppet code or via Hiera:

restic::repositories:
  '/mnt/backup':
    ensure: present
    password: 'mysuperpassword'

Now you can periodically backup to that repository with the following Hiera:

restic::backups:
  'home':
    path: '/home'
    repository: '/mnt/backup'
    password: "%{lookup('restic::repositories.\"/mnt/backup\".password')}"
    timer: '*-*-* 06:00:00'

This will backup the /home folder everyday at 6AM.

Reference

Classes

  • restic: The main class used to install the module and manage resources.
  • restic::install: Installs Restic using the package manager and creates the required user and group.

Define Resources

  • restic::backup: Controls backing up data to a restic::repository.
  • restic::repository: Creates a new Restic repository to store backed-up files.

Limitations

This module has only been tested on Debian 9 and 10.

Development

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