1 # Bacula storage configuration for a client.
3 # This is stored config by a client and then collected on the storage
5 # @param director_server director for this client
6 # @param client name/address of the client (relevant for device names, media type names, etc.)
7 # @param volume_retention_full how long to keep volumes with full backups
8 # @param volume_retention_diff how long to keep volumes with differential backups
9 # @param volume_retention_inc how long to keep volumes with incremental backups
10 define bacula::storage::client(
11 String $director_server,
12 Stdlib::Host $client = $name,
13 String $volume_retention_full = '100 days', # XXX remove defaults
14 String $volume_retention_diff = '50 days', # XXX remove defaults
15 String $volume_retention_inc = '30 days', # XXX remove defaults
17 include bacula::storage
19 $device_name = "${bacula::storage::filestor_device}-${client}"
20 $media_type_name = "${bacula::storage::filestor_name}-${client}"
21 $directory = "${bacula::storage::backup_path}/${client}"
23 # this is created in both bacula::storage::client and
24 # bacula::storage::director and needs to be the same
25 $dir_storage_secret = hkdf('/etc/puppet/secret', "bacula::director<->storage::${director_server}<->${::fqdn}")
28 "/etc/bacula/storage-conf.d/${client}.conf":
29 content => template('bacula/storage/sd-per-client.conf.erb'),
32 notify => Exec['bacula-sd restart-when-idle'],
42 # enable the director to make (client, storage) specific configuration
43 @@bacula::director::client_from_storage { $client:
44 tag => "bacula::to-director::${director_server}",
46 storage_address => $bacula::storage::storage_address,
47 port_sd => $bacula::storage::port_sd,
48 storage_secret => $dir_storage_secret,
49 storage_device_name => $device_name,
50 storage_media_type_name => $media_type_name,
51 volume_retention_full => $volume_retention_full,
52 volume_retention_diff => $volume_retention_diff,
53 volume_retention_inc => $volume_retention_inc,