Make rentention periods configurable with hiera, per client
[mirror/dsa-puppet.git] / modules / bacula / manifests / client / director.pp
1 # Bacula fd config: director snippet
2 #
3 # Each/The director exports this class to be collected by each fd.
4 #
5 # @param director_name     bacula name of the dir instance
6 # @param director_address  address of this dir instance that other instances should connect to (dns name)
7 # @param messages_name   name of the Messages Resource
8 define bacula::client::director(
9   String $director_name,
10   Stdlib::Host $director_address,
11   String $messages_name,
12 ) {
13   include bacula::client
14
15   $dir_client_secret = hkdf('/etc/puppet/secret', "bacula::director<->fd::${director_address}<->${::fqdn}")
16
17   @@bacula::director::client { $bacula::client::client:
18     tag            => "bacula::to-director::${director_address}",
19     port_fd        => $bacula::client::port_fd,
20     client         => $bacula::client::client,
21     client_name    => $bacula::client::client_name,
22     client_secret  => $dir_client_secret,
23     file_retention => $bacula::client::file_retention,
24     job_retention  => $bacula::client::job_retention,
25   }
26
27   file {
28     "/etc/bacula/fd-conf.d/Dir_${director_address}.conf":
29       content => template('bacula/client/fd-per-director.conf.erb'),
30       mode    => '0440',
31       group   => bacula,
32       notify  => Exec['bacula-fd restart-when-idle'],
33       ;
34   }
35 }