X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fbacula%2Fmanifests%2Fdirector%2Fclient.pp;h=f021819f0fc5ee4a25f5dcc9f85c0494f5a1cfd1;hb=c46ff2155be94c3e1c3226879e13a8f31dbbac1b;hp=dc4dafc5e62090ba7d21866c08464d501424923f;hpb=60e3d192b636a817ee75524e75d4e8c953841a49;p=mirror%2Fdsa-puppet.git diff --git a/modules/bacula/manifests/director/client.pp b/modules/bacula/manifests/director/client.pp index dc4dafc5e..f021819f0 100644 --- a/modules/bacula/manifests/director/client.pp +++ b/modules/bacula/manifests/director/client.pp @@ -2,40 +2,34 @@ # # This is stored config by a client, collected on the director # -# @param port_fd port that this node's bacula-fd is listening on -# @param client The name of the client (relevant for device names, media type names, etc.) +# @param port_fd port that this node's bacula-fd is listening on +# @param client name of the client (relevant for device names, media type names, etc.) +# @param client_name bacula client name +# @param client_secret shared secret between director and client +# @param file_retention how long to keep information about which files are in which volumes/jobs +# @param job_retention how long to keep job records define bacula::director::client ( - Integer $port_fd = 9102, - String $client = $name, + Integer $port_fd, + Stdlib::Host $client = $name, + String $client_name, + String $client_secret, + String $file_retention = '30 days', # XXX remove defaults + String $job_retention = '100 days', # XXX remove defaults ) { - include bacula + include bacula::director - $bacula_pool_name = $bacula::bacula_pool_name - $bacula_filestor_name = $bacula::bacula_filestor_name - $bacula_filestor_device = $bacula::bacula_filestor_device - $bacula_storage_address = $bacula::bacula_storage_address - $bacula_storage_port = $bacula::bacula_storage_port - $bacula_storage_secret = $bacula::bacula_storage_secret + # we define this in both bacula::director::client_from_storage and + # bacula::director::client and it needs to match. + $pool_name = "${bacula::director::pool_name}-${client}" - $bacula_ca_path = $bacula::bacula_ca_path - $bacula_ssl_client_cert = $bacula::bacula_ssl_client_cert - $bacula_ssl_client_key = $bacula::bacula_ssl_client_key - - $bacula_client_name = "${client}-fd" - $bacula_client_secret = hkdf('/etc/puppet/secret', "bacula-fd-${client}") - - file { "/etc/bacula/conf.d/${client}.conf": - content => template('bacula/director/dir-per-client.erb'), - mode => '0440', - group => bacula, - notify => Exec['bacula-director reload'] - } - - file { "/etc/bacula/storages-list.d/${client}.storage": - content => "${bacula::bacula_filestor_client}-${client}\n", - mode => '0440', - group => bacula, - notify => Exec['bacula-director reload'] + if defined(File["/etc/bacula/conf.d/${client}_storage.conf"]) { + # this config is only valid if the pools defined in ${client}_storage exist. + file { "/etc/bacula/conf.d/${client}.conf": + content => template('bacula/director/dir-per-client.erb'), + mode => '0440', + group => bacula, + notify => Exec['bacula-director reload'] + } } }