# @param port_fd port that bacula-fd listens on
# @param client_name bacula client name for this instance
# @param ensure present or absent
+# @param volume_retention_full how long to keep volumes with full backups
+# @param volume_retention_diff how long to keep volumes with differential backups
+# @param volume_retention_inc how long to keep volumes with incremental backups
+# @param file_retention how long to keep information about which files are in which volumes/jobs
+# @param job_retention how long to keep job records
class bacula::client(
Stdlib::Host $director_server,
Stdlib::Host $storage_server,
Integer $port_fd = 9102,
String $client_name = "${::fqdn}-fd",
Enum['present', 'absent'] $ensure = defined(Class['bacula::not_a_client']) ? { true => 'absent', default => 'present' },
+ String $volume_retention_full = '100 days',
+ String $volume_retention_diff = '50 days',
+ String $volume_retention_inc = '30 days',
+ String $file_retention = '30 days',
+ String $job_retention = $volume_retention_full,
) inherits bacula {
$package_ensure = $ensure ? { 'present' => 'installed', 'absent' => 'purged' }
$service_ensure = $ensure ? { 'present' => 'running', 'absent' => 'stopped' }
}
@@bacula::storage::client { $client:
- tag => "bacula::to-storage::${storage_server}",
- client => $client,
- director_server => $director_server,
+ tag => "bacula::to-storage::${storage_server}",
+ client => $client,
+ director_server => $director_server,
+ volume_retention_full => $volume_retention_full,
+ volume_retention_diff => $volume_retention_diff,
+ volume_retention_inc => $volume_retention_inc,
}
@@concat::fragment { "bacula-dsa-client-list::${client}":
$dir_client_secret = hkdf('/etc/puppet/secret', "bacula::director<->fd::${director_address}<->${::fqdn}")
@@bacula::director::client { $bacula::client::client:
- port_fd => $bacula::client::port_fd,
- client => $bacula::client::client,
- client_name => $bacula::client::client_name,
- client_secret => $dir_client_secret,
- tag => "bacula::to-director::${director_address}",
+ tag => "bacula::to-director::${director_address}",
+ port_fd => $bacula::client::port_fd,
+ client => $bacula::client::client,
+ client_name => $bacula::client::client_name,
+ client_secret => $dir_client_secret,
+ file_retention => $bacula::client::file_retention,
+ job_retention => $bacula::client::job_retention,
}
file {
#
# This is stored config by a client, collected on the director
#
-# @param port_fd port that this node's bacula-fd is listening on
-# @param client name of the client (relevant for device names, media type names, etc.)
-# @param client_name bacula client name
-# @param client_secret shared secret between director and client
+# @param port_fd port that this node's bacula-fd is listening on
+# @param client name of the client (relevant for device names, media type names, etc.)
+# @param client_name bacula client name
+# @param client_secret shared secret between director and client
+# @param file_retention how long to keep information about which files are in which volumes/jobs
+# @param job_retention how long to keep job records
define bacula::director::client (
Integer $port_fd,
Stdlib::Host $client = $name,
String $client_name,
String $client_secret,
+ String $file_retention = '30 days', # XXX remove defaults
+ String $job_retention = '100 days', # XXX remove defaults
) {
include bacula::director
# @param storage_secret Shared secret between storage and director
# @param storage_device_name Device name on the storage daemon for this node's backups
# @param storage_media_type_name Media type name on the storage daemon for this node's backupse
+# @param volume_retention_full how long to keep volumes with full backups
+# @param volume_retention_diff how long to keep volumes with differential backups
+# @param volume_retention_inc how long to keep volumes with incremental backups
define bacula::director::client_from_storage (
Stdlib::Host $storage_address,
Integer $port_sd,
String $storage_secret,
String $storage_device_name,
String $storage_media_type_name,
+ String $volume_retention_full = '100 days', # XXX remove defaults
+ String $volume_retention_diff = '50 days', # XXX remove defaults
+ String $volume_retention_inc = '30 days', # XXX remove defaults
Stdlib::Host $client = $name,
) {
#
# @param director_server director for this client
# @param client name/address of the client (relevant for device names, media type names, etc.)
+# @param volume_retention_full how long to keep volumes with full backups
+# @param volume_retention_diff how long to keep volumes with differential backups
+# @param volume_retention_inc how long to keep volumes with incremental backups
define bacula::storage::client(
String $director_server,
- Stdlib::Host $client = $name
+ Stdlib::Host $client = $name,
+ String $volume_retention_full = '100 days', # XXX remove defaults
+ String $volume_retention_diff = '50 days', # XXX remove defaults
+ String $volume_retention_inc = '30 days', # XXX remove defaults
) {
include bacula::storage
storage_secret => $dir_storage_secret,
storage_device_name => $device_name,
storage_media_type_name => $media_type_name,
+ volume_retention_full => $volume_retention_full,
+ volume_retention_diff => $volume_retention_diff,
+ volume_retention_inc => $volume_retention_inc,
}
}
Pool Type = Backup
Storage = "<%= @storage_name %>"
AutoPrune = yes
- Volume Retention = 100 days
+ Volume Retention = <%= @volume_retention_full %>
Label Format = "<%= @pool_name %>-full.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
Volume Use Duration = 23h
Maximum Volume Jobs = 1
Pool Type = Backup
Storage = "<%= @storage_name %>"
AutoPrune = yes
- Volume Retention = 50 days
+ Volume Retention = <%= @volume_retention_diff %>
Label Format = "<%= @pool_name %>-diff.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
Volume Use Duration = 23h
Maximum Volume Jobs = 1
Pool Type = Backup
Storage = "<%= @storage_name %>"
AutoPrune = yes
- Volume Retention = 30 days
+ Volume Retention = <%= @volume_retention_inc %>
Label Format = "<%= @pool_name %>-inc.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
Volume Use Duration = 23h
Maximum Volume Jobs = 1
FDPort = <%= @port_fd %>
Catalog = MyCatalog
Password = "<%= @client_secret %>"
- File Retention = 30 days
- Job Retention = 3 months
+ File Retention = <%= @file_retention %>
+ Job Retention = <%= @job_retention %>
AutoPrune = yes
TLS Enable = yes