Forge Home

borgbackup

Backups using borg

483 downloads

136 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

  • 0.1.3 (latest)
  • 0.1.2
  • 0.1.1
  • 0.1.0
released Aug 23rd 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, 2018.1.x
  • Puppet >= 5.5.0 < 8.0.0

Start using this module

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

Add this module to your Puppetfile:

mod 'tails-borgbackup', '0.1.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add tails-borgbackup
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install tails-borgbackup --version 0.1.3

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

tails/borgbackup — version 0.1.3 Aug 23rd 2023

borgbackup

Table of Contents

  1. Description
  2. Setup - The basics of getting started with borgbackup
  3. Usage - Configuration options and additional functionality
  4. Development - Guide for contributing to the module

Description

This module is intended to facilitate a backup scheme based on borg with the following security properties:

  • compromise of a node cannot escalate to compromise of backups
  • compromise of the backup server cannot escalate to compromise of nodes

To accomplish this, the backup server is assumed to be managed masterless and nodes are restricted to append-only access.

This has a number of downsides:

  • access to the backupserver has to be configured manually and cannot be automated with exported resources.
  • purging of old backups will have to be done manually.

If you are looking for a backup solution with as little configuration effort as possible, you are probably better off with the Vox Populi module.

Setup

Important: to be able to recover from backups, you will need access to the following three:

  • the BORG_PASSPHRASE, set is borgbackup::client::borgpassphrase
  • ssh access to the backup server
  • the client's keyfile, stored in /root/.config/borg/keys

This module does not arrange these requirements for you! Make sure you have local copies of the BORG_PASSPHRASE as well as the clients' keys on the machine you want to use for recovery.

Backup server

The backup server can be configured as follows:

include borgbackup::server

To grant nodes access to write backups, fill your hiera with something like:

borgbackups::server::clients:
  hostname1:
    type: ssh-rsa
    data: AAAAgnove41...
  hostname2:
    type: ssh-rsa
    data: AAAAnbor0ve..

This will create users named hostname1, hostname2, etc. You will need to make sure you provide yourself (or anyone who needs access to the backups) with ssh access to these accounts.

Backup client

All requirements for running backup jobs can be installed as follows:

include borgbackup::client

This class is included in the backup_lv and backup_fs defined types, so there is no strict need to do so explicitly in your own manifests.

You will need to provide the BORG_PASSPHRASE variable in hiera (preferably using eyaml):

borgbackup::client::borgpassphrase: supersecret

Usage

This module supports two types of backup jobs:

  • backing up logical volumes through backup_lv
  • backing up data from filesystem through backup_fs

Backing up logical volumes

A systemd timer that ensures a weekly backup run can be created like this:

borgbackup::backup_lv { 'backstuffup':
  excludes     => ['/var/log','/tmp'],
  backupserver => 'backups.example.org',
  vg           => 'myvolume',
  lv           => 'stuff',
}

This assumes the logical volume to contain a paritioned disk image. In case the logical volume directly contains a filesystem, add the rawdisk parameter:

borgbackup::backup_lv { 'backstuffup':
  excludes     => ['/var/log','/tmp'],
  backupserver => 'backups.example.org',
  vg           => 'myvolume',
  lv           => 'stuff',
  rawdisk      => true,
}

Backing up from filesystem

To create a weekly backup of (part of) your filesystem, you can apply:

borgbackup::backup_fs { 'backstuffup':
  backupserver => 'backups.example.org',
  mountpoint   => '/home',
}

Development

Merge requests are welcome. If you wish to share any security issues, please contact tails-sysadmins@boum.org. Our PGP fingerprint is: D113CB6D5131D34BA5F0FE9E70F4F03116525F43