Since the conditional does not work for default values for params, fall back to sane...
[mirror/dsa-puppet.git] / modules / bacula / manifests / director.pp
index 9843e55..696ed7b 100644 (file)
@@ -12,8 +12,8 @@
 # @param director_address  address of this dir instance that other instances should connect to (dns name)
 # @param messages_name   name of the Messages Resource
 class bacula::director(
-  String  $db_address,
-  Integer $db_port,
+  String  $db_address = 'localhost',
+  Integer $db_port = 5432,
   String  $db_name = 'bacula',
   String  $db_user = 'bacula',
   String  $db_password = hkdf('/etc/puppet/secret', "bacula-db-${::hostname}"),
@@ -31,6 +31,10 @@ class bacula::director(
   $some_pool_name = "poolfull-${pool_name}-${director_address}"
   $some_client_name = "${director_address}-fd"
 
+  $real_email_error    = $bacula::email_error    ? { true => $bacula::email_error   , default => 'root@localhost' }
+  $real_email_operator = $bacula::email_operator ? { true => $bacula::email_operator, default => 'root@localhost' }
+  $real_email_daemon   = $bacula::email_daemon   ? { true => $bacula::email_daemon  , default => 'root@localhost' }
+
   # let the SD know we exist
   @@bacula::storage::director{ $::fqdn:
     tag              => 'bacula::to-storage',
@@ -63,7 +67,7 @@ class bacula::director(
   dsa_systemd::override { 'bacula-director':
     content => @(EOT)
       [Unit]
-      After=unbound.service
+      After=network-online.target unbound.service
       | EOT
   }
 
@@ -99,8 +103,8 @@ class bacula::director(
     notify  => Exec['bacula-director reload']
   }
 
-  Bacula::Director::Client             <<| tag == "bacula::to-director::${::fqdn}" |>>
   Bacula::Director::Client_from_storage<<| tag == "bacula::to-director::${::fqdn}" |>>
+  Bacula::Director::Client             <<| tag == "bacula::to-director::${::fqdn}" |>>
 
   package { 'bacula-console':
     ensure => installed;