Split the director config coming from each node in two parts: one that comes from...
[mirror/dsa-puppet.git] / modules / bacula / manifests / director / client.pp
1 # Bacula client config on the director
2 #
3 # This is stored config by a client, collected on the director
4 #
5 # @param port_fd   port that this node's bacula-fd is listening on
6 # @param client The name of the client (relevant for device names, media type names, etc.)
7 define bacula::director::client (
8   Integer $port_fd = 9102,
9   String $client = $name,
10 ) {
11   include bacula::director
12
13   $bacula_ca_path         = $bacula::bacula_ca_path
14   $bacula_ssl_client_cert = $bacula::bacula_ssl_client_cert
15   $bacula_ssl_client_key  = $bacula::bacula_ssl_client_key
16
17   $client_name   = "${client}-fd"
18   $client_secret = hkdf('/etc/puppet/secret', "bacula-fd-${client}")
19
20   # we define this in both bacula::director::client_from_storage and
21   # bacula::director::client and it needs to match.
22   $pool_name     = "${bacula::director::pool_name}-${client}"
23
24   file { "/etc/bacula/conf.d/${client}.conf":
25     content => template('bacula/director/dir-per-client.erb'),
26     mode    => '0440',
27     group   => bacula,
28     notify  => Exec['bacula-director reload']
29   }
30 }
31