Commits (2)
fixtures:
repositories:
"concat":
"repo": "https://github.com/puppetlabs/puppetlabs-concat.git"
symlinks:
"borg": "#{source_dir}"
......@@ -47,19 +47,21 @@ An advanced example might look like:
borg::backup {
'kvm':
backup_path => '/',
archive_path => 'kvm',
archive_path => 'foo@bar:/data/borg/kvm',
passphrase => '12345-super-strong',
exclude => [ '/proc', '/sys', '/var/lib/libvirt/images', '/mnt' ],
prune => true,
daily => 7,
weekly => 4,
monthly => 0,
log => true,
type => 'sshfs',
sshfs_mount => '/data/foobar',
cron_time => '0 2 * * *';
backup_path => '/',
archive_path => 'kvm',
archive_path => 'foo@bar:/data/borg/kvm',
passphrase => '12345-super-strong',
exclude => [ '/proc', '/sys', '/var/lib/libvirt/images', '/mnt' ],
prune => true,
daily => 7,
weekly => 4,
monthly => 0,
log => true,
type => 'sshfs',
sshfs_mount => '/data/foobar',
cron_time => '0 2 * * *',
envvar_relocated_repo => true,
envvar_unknown_repo => true;
'mnt':
backup_path => '/mnt',
......@@ -268,6 +270,26 @@ When the cron job will run. This should respect the cron time format.
Default value: `0 1 * * *`.
#### `envvar_relocated_repo`
Optional.
Data type: Boolean.
Sets the `BORG_RELOCATED_REPO_ACCESS_IS_OK` environment variable.
Default value: `false`.
#### `envvar_unknown_repo`
Optional.
Data type: Boolean.
Sets the `BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK` environment variable.
Default value: `false`.
## Limitations
This module was developed for Debian Stretch and Puppet 4. Compatibility on
......
define borg::backup (
String $backup_path = '/',
String $archive_name = undef,
String $archive_path = undef,
String $backup_path = '/',
String $archive_name = undef,
String $archive_path = undef,
Variant[String, Undef] $passphrase = undef,
Array $exclude = [ '/proc', '/sys' ],
Boolean $prune = true,
Integer $daily = 7,
Integer $weekly = 4,
Integer $monthly = 6,
Integer $yearly = 0,
Boolean $log = false,
Enum $type = [ 'borg', 'sshfs' ],
String $sshfs_mount = '/mnt',
String $user = 'root',
String $cron_time = '0 1 * * *' ) {
Array $exclude = [ '/proc', '/sys' ],
Boolean $prune = true,
Integer $daily = 7,
Integer $weekly = 4,
Integer $monthly = 6,
Integer $yearly = 0,
Boolean $log = false,
Enum $type = [ 'borg', 'sshfs' ],
String $sshfs_mount = '/mnt',
String $user = 'root',
String $cron_time = '0 1 * * *',
Boolean $envvar_relocated_repo = false,
Boolean $envvar_unknown_repo = false ) {
file {
"/usr/local/sbin/borg-${name}":
content => epp('borg/backups.epp', {
'name' => $name,
'backup_path' => $backup_path,
'archive_name' => $archive_name,
'archive_path' => $archive_path,
'passphrase' => $passphrase,
'exclude' => $exclude,
'prune' => $prune,
'daily' => $daily,
'weekly' => $weekly,
'monthly' => $monthly,
'yearly' => $yearly,
'log' => $log,
'type' => $type,
'sshfs_mount' => $sshfs_mount,
'user' => $user,
'cron_time' => $cron_time,
'name' => $name,
'backup_path' => $backup_path,
'archive_name' => $archive_name,
'archive_path' => $archive_path,
'passphrase' => $passphrase,
'exclude' => $exclude,
'prune' => $prune,
'daily' => $daily,
'weekly' => $weekly,
'monthly' => $monthly,
'yearly' => $yearly,
'log' => $log,
'type' => $type,
'sshfs_mount' => $sshfs_mount,
'user' => $user,
'cron_time' => $cron_time,
'envvar_relocated_repo' => $envvar_relocated_repo,
'envvar_unknown_repo' => $envvar_unknown_repo,
}),
owner => $user,
group => $user,
......
{
"name": "baldurmen-borg",
"version": "1.0.1",
"version": "1.0.2",
"author": "Louis-Philippe Véronneau",
"summary": "Simple puppet module to configure backups with borg.",
"license": "GPL-3.0",
......
......@@ -6,6 +6,12 @@
# <%= $name %>
<% if $envvar_relocated_repo { -%>
export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes
<% } -%>
<% if $envvar_unknown_repo { -%>
export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes
<% } -%>
<% if $passphrase { -%>
export BORG_PASSPHRASE=<%= $passphrase %>
<% } -%>
......