Remove defaults
[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     port_fd       => $bacula::client::port_fd,
19     client        => $bacula::client::client,
20     client_name   => $bacula::client::client_name,
21     client_secret => $dir_client_secret,
22     tag           => "bacula::to-director::${director_address}",
23   }
24
25   file {
26     "/etc/bacula/fd-conf.d/Dir_${director_address}.conf":
27       content => template('bacula/client/fd-per-director.conf.erb'),
28       mode    => '0440',
29       group   => bacula,
30       notify  => Exec['bacula-fd restart-when-idle'],
31       ;
32   }
33 }