Forge Home

restic

Restic module

852 downloads

852 latest version

3.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

  • 1.0.1 (latest)
released May 3rd 2021
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
  • Puppet >= 6.21.0 < 8.0.0

Start using this module

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

Add this module to your Puppetfile:

mod 'cheasles-restic', '1.0.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install cheasles-restic --version 1.0.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

cheasles/restic — version 1.0.1 May 3rd 2021

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.