Giter Club home page Giter Club logo

puppet-borgbackup's Introduction

borg backup puppet module

Build Status Puppet Forge Puppet Forge Puppet Forge Puppet Forge

Table of Contents

  1. Overview
  2. Usage
  3. Reference
  4. Contributing

Overview

Configure borg backups and gives you the option to store passphrase and keyfile needed for encrypted backups in a git repository. The content of the git repository is encrypted with gpg keys (configurable) for security.

Usage

For typical usage of this module you configure two nodes. One node to backup and another as the target where the backup should be stored. Below is a minimal configuration.

the node to backup (node-A)

In the nodes manifest:

include ::borgbackup

The hiera configuration for the node:

# the resource to use for ssh key generation and the parameters:
borgbackup::ssh_key_define: 'file'
borgbackup::ssh_key_res:
  '/etc/borgbackup/.ssh/id_rsa':
      owner: 'root'
      group: 'root'
      mode: '0700'
      content: 'key_data'

# specify the target node for the backup:
borgbackup::default_target: "borgbackup@node-target:/srv/borgbackup/%{::fqdn}"

# specify the ssh key to access node-target:
borgbackup::repos_defaults:
  env_vars:
    BORG_RSH: 'ssh -i /etc/borgbackup/.ssh/id_rsa'

To add an archive to the default borg repo (named $::fqdn) use

::borgbackup::archive{'my_archive':
  create_includes = ['/etc'],
}

the target node (node-target)

include ::borgbackup::server

The hiera configuration for the node:

# authorize the key generated on node-A for backup
borgbackup::server::authorized_keys:
  node-A:
    keys:
       - 'ssh-... .... borg backups'

Remark: the initialization of the borg backup repository fails until you configured the ssh key on node-target.

use a remote git repository

To store the generated passphrase and the keyfile in a secure and automated manner, you can use a git repository. Add the following hiera configuration to node-A to fetch and commit to remote gitrepo on node-git:

# the git repo to clone and commit
borgbackup::git::gitrepo: 'user@node-git:/path-to-repo'
# ssh private key to access the git repo. This key should only have  access to this repo !
borgbackup::git::gitrepo_sshkey: |
  -----BEGIN OPENSSH PRIVATE KEY-----
  ...
  -----END OPENSSH PRIVATE KEY-----

# add pgp public keys of users who should be able to decrypt the passphrase and the keyfile.
# to export use:
# gpg --export --armor --export-options no-export-attributes,export-minimal ID
borgbackup::git::gpg_keys:
  ID-of-user-1: |
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    ...
  ID-of-user-2: |
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    ...

Remark: if you add or delete gpg_keys, the repository should automatically reencrypt and push to the git repository.

Remark: ID-of-user should point to the main email of the pgp key. If you see runing reencrypt with each puppet run on the nodes, then the ID-of-user is probably wrong.

Reference

All classes and defines are documented with all parameters in the corresponding code file and in the REFERENCE document.

Contributing

Please report bugs and feature request using GitHub issue tracker.

For pull requests, it is very much appreciated to check your Puppet manifest with puppet-lint and the available spec tests in order to follow the recommended Puppet style guidelines from the Puppet Labs style guide.

Authors

This module is mainly written by Cirrax GmbH.

See the list of contributors for a list of all contributors.

puppet-borgbackup's People

Contributors

runejuhl avatar trefzer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.