Skip to content

Latest commit

 

History

History
425 lines (236 loc) · 11.6 KB

REFERENCE.md

File metadata and controls

425 lines (236 loc) · 11.6 KB

Reference

Table of Contents

Classes

Public Classes

  • borg: Main class, includes all other classes.

Private Classes

  • borg::config
  • borg::install: This class handles the installation. Avoid modifying private classes.
  • borg::service

Classes

borg

Main class, includes all other classes.

Parameters

The following parameters are available in the borg class:

package_name

Data type: Variant[String[1],Array[String[1]]]

Name of the borg package

create_prometheus_metrics

Data type: Boolean

Enable a postrun command to create prometheus compatible metrics about all backups

Default value: true

use_upstream_reporter

Data type: Boolean

Enable to upstream reporter (see create_prometheus_metrics param) or our vendored version

Default value: false

update_borg_restore_db_after_backuprun

Data type: Boolean

Enable the restore helper from Florian 'Bluewind' Pritz (https://metacpan.org/release/App-BorgRestore) as another postrun command (see also the install_restore_script parameter)

Default value: true

manage_prune

Data type: Boolean

Enable management of backup prunes. If this is set to false all keep_* parameters are ignored.

Default value: true

keep_yearly

Data type: Integer[0]

For how many years should we keep our backups?

Default value: 3

keep_monthly

Data type: Integer[0]

For how many months should we keep our backups?

Default value: 24

keep_weekly

Data type: Integer[0]

For how many weeks should we keep our backups?

Default value: 36

keep_daily

Data type: Integer[0]

For how many days should we keep our backups?

Default value: 60

keep_within

Data type: Integer[0]

For how many days should we keep all backups we have?

Default value: 30

compression

Data type: String[1]

Compression method and level to use. See the output of borg help compression for available options.

Default value: 'lz4'

working_directory

Data type: Stdlib::Absolutepath

The working directory from where the backup should be created.

Default value: '/'

source_paths

Data type: Array[String[1]]

A list of relative or absolute paths to backup.

Default value: ['/']

excludes

Data type: Array[Stdlib::Absolutepath]

list of default mountpoints that should be excluded from backups. Every mountpoint needs to be explicitly excluded or included. See also the additional_excludes parameter.

Default value: ['/tmp', '/sys', '/dev', '/proc', '/run', '/media', '/var/lib/nfs/rpc_pipefs']

includes

Data type: Array[Stdlib::Absolutepath]

list of default mountpoints that should be included from backups. Every mountpoint needs to be explicitly excluded or included. See also the additional_includes parameter.

Default value: ['/', '/boot', '/boot/efi', '/boot/EFI', '/var/log']

backupserver

Data type: String[1]

FQDN for the remote server. Will be written into the local ssh client configuration file.

install_restore_script

Data type: Boolean

Install the restore helper via cpanm.

restore_script_path

Data type: Stdlib::Absolutepath

The path to the restore helper.

backupdestdir

Data type: String[1]

The path on the remote server where the backups should be written to. $username will be prepended

Default value: 'borg'

backupdatadir

Data type: Stdlib::Absolutepath

The path where additional backup data should be stored.

Default value: '/root/backup-data/'

absolutebackupdestdir

Data type: Optional[String[1]]

By defaults, backups will be written on the remote host to $username/$backupdestdir. if $absolutebackupdestdir is set this will be used instead

Default value: undef

manage_repository

Data type: Boolean

A Boolean that enables/disables repository management. Only true on Ubuntu 16.04 at the moment

exclude_pattern

Data type: Array[String[1]]

We currently support excludes/includes for mountpoints. borg supports also a list of shell glob/regex pattern to filter for files.

Default value: ['sh:/home/*/.cache/*', 'sh:/root/.cache/*', 'sh:/var/cache/pacman/pkg/*']

additional_exclude_pattern

Data type: Array[String[1]]

Another array of patterns to extend the modules built-in list (exclude_pattern parameter).

Default value: []

restore_dependencies

Data type: Array[String[1]]

A list of dependencies for the restore helper.

Default value: []

package_ensure

Data type: String[1]

Ensure state for the borg package.

Default value: present

additional_excludes

Data type: Array[Stdlib::Absolutepath]

Another array of mountpoints to extend the modules built-in list (excludes parameter).

Default value: []

additional_includes

Data type: Array[Stdlib::Absolutepath]

Another array of mountpoints to extend to modules built-in list (includes parameter).

Default value: []

username

Data type: String[1]

The ssh username to connect to the remote borg service.

Default value: $facts['networking']['hostname']

ssh_port

Data type: Stdlib::Port

SSH port for the remote server (default: 22). Will be written into the local ssh client configuration file.

Default value: 22

borg_restore_version

Data type: Pattern[/^\d*\.\d*\.\d*$/]

Version for the perl script App::BorgRestore. change this version and the module will upgrade/downgrade it

Default value: '3.4.5'

install_fatpacked_cpanm

Data type: Boolean

cpanm is required on systems where we want to have App::BorgRestore. Legacy systems ship a too old cpanm version. For those operating systems we can install the upstream version.

proxy_type

Data type: Optional[Enum['none', 'ftp','http','https']]

configue a network proxy type for the archive resources in this module. You also need to set proxy_server if you need a proxy.

Default value: undef

proxy_server

Data type: Optional[String[1]]

Configurea network proxy for the archive resources in this module. By default no proxy will be used

Default value: undef

manage_package

Data type: Boolean

Enable/Disable management of the actual borg package. People on legacy OS or isolated environments can disable this and manage the binary in their profile.

Default value: true

ssh_key_type

Data type: Enum['rsa', 'ed25519']

configure your most favourite ssh key type. This will be used to connect to the remote borg server.

Default value: 'ed25519'

backuptime

Data type: Hash[String[1],String[1]]

Configure the name of each backupjob and the time of that job.

Default value: { 'default' => '18:30:00' }

ssh_proxyjump

Data type: Optional[String[1]]

Configure possible bastionhosts for the connection.

Default value: undef

wants

Data type: Array[String[1]]

Array of units where the borg-backup service should depend on

Default value: ['network-online.target']

requires

Data type: Array[String[1]]

Array of units which the borg-backup service should require

Default value: []

after

Data type: Array[String[1]]

Array of units that should be started before the borg-backup service

Default value: ['network-online.target']

pre_backup_script

Data type: Optional[String[1]]

BASH code to be executed before the backup job starts. If you wish to use snapshots, create them here.

Default value: undef

post_backup_script

Data type: Optional[String[1]]

BASH code to be executed after the backup job has finished. If you need to perform any cleanup do so here.

Default value: undef

restore_package

Data type: Optional[String[1]]

Optional package name for the perl based script

Default value: undef

upload_ratelimit

Data type: Integer[0]

Upload ratelimit in kiByte/s. Default: 0=unlimited

Default value: 0