Only realize the director-from-client config if the director-from-client-via-storage...
[mirror/dsa-puppet.git] / modules / bacula / manifests / director / client.pp
index cbfd139..f021819 100644 (file)
@@ -18,19 +18,18 @@ define bacula::director::client (
 ) {
   include bacula::director
 
-  $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
-
   # 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}"
 
-  file { "/etc/bacula/conf.d/${client}.conf":
-    content => template('bacula/director/dir-per-client.erb'),
-    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']
+    }
   }
 }