- $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']
+ }