cbfd139841442370955adcb4b6acea850819c99c
[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 # @param file_retention  how long to keep information about which files are in which volumes/jobs
10 # @param job_retention   how long to keep job records
11 define bacula::director::client (
12   Integer $port_fd,
13   Stdlib::Host $client = $name,
14   String $client_name,
15   String $client_secret,
16   String $file_retention = '30 days', # XXX remove defaults
17   String $job_retention = '100 days', # XXX remove defaults
18 ) {
19   include bacula::director
20
21   $bacula_ca_path         = $bacula::bacula_ca_path
22   $bacula_ssl_client_cert = $bacula::bacula_ssl_client_cert
23   $bacula_ssl_client_key  = $bacula::bacula_ssl_client_key
24
25   # we define this in both bacula::director::client_from_storage and
26   # bacula::director::client and it needs to match.
27   $pool_name     = "${bacula::director::pool_name}-${client}"
28
29   file { "/etc/bacula/conf.d/${client}.conf":
30     content => template('bacula/director/dir-per-client.erb'),
31     mode    => '0440',
32     group   => bacula,
33     notify  => Exec['bacula-director reload']
34   }
35 }
36