09117c66b5c6f0cd867681c3948cfcba098bb005
[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        name of the client (relevant for device names, media type names, etc.)
7 # @param client_name   bacula client name
8 # @param client_secret shared secret between director and client
9 define bacula::director::client (
10   Integer $port_fd,
11   Stdlib::Host $client = $name,
12   String $client_name,
13   String $client_secret,
14 ) {
15   include bacula::director
16
17   $bacula_ca_path         = $bacula::bacula_ca_path
18   $bacula_ssl_client_cert = $bacula::bacula_ssl_client_cert
19   $bacula_ssl_client_key  = $bacula::bacula_ssl_client_key
20
21   # we define this in both bacula::director::client_from_storage and
22   # bacula::director::client and it needs to match.
23   $pool_name     = "${bacula::director::pool_name}-${client}"
24
25   file { "/etc/bacula/conf.d/${client}.conf":
26     content => template('bacula/director/dir-per-client.erb'),
27     mode    => '0440',
28     group   => bacula,
29     notify  => Exec['bacula-director reload']
30   }
31 }
32