continue with moving director name/address to a more local thing
[mirror/dsa-puppet.git] / modules / bacula / manifests / director.pp
index 5c522c5..ca065c7 100644 (file)
@@ -8,6 +8,7 @@
 # @param port_dir       Port that the director should listen on
 # @param db_sslca       SSL CA store for DB access
 # @param director_name  bacula name of this dir instance
+# @param director_address  address of this sd instance that other instances should connect to (dns name)
 class bacula::director(
   String  $db_address,
   Integer $db_port,
@@ -18,12 +19,14 @@ class bacula::director(
   Optional[String] $db_sslca = undef,
   #String $director_name    = "${::fqdn}-dir",
   String $director_name = $bacula::bacula_director_name,
+  Stdlib::Host $director_address = $::fqdn,
 ) inherits bacula {
 
   # used by e.g. bconsole
   $director_secret = hkdf('/etc/puppet/secret', "bacula-dir-${::fqdn}")
-  # the RestoreFiles Job needs a Pool.  Any valid pool.
-  $some_pool_name = "poolfull-${pool_name}-${bacula::bacula_director_address}"
+  # the RestoreFiles Job needs a Pool and a client.  Any valid pool and client.
+  $some_pool_name = "poolfull-${pool_name}-${director_address}"
+  $some_client_name = "${director_address}-fd"
 
   ensure_packages ( [
     'bacula-director-pgsql',
@@ -144,7 +147,7 @@ class bacula::director(
     saddr       => $bacula::public_addresses,
   }
   @@ferm::rule::simple { "bacula::director-to-storage::${::fqdn}":
-    tag         => "bacula::director-to-storage::${::fqdn}",
+    tag         => 'bacula::director-to-storage',
     description => 'Allow bacula-storage access from the bacula-director',
     chain       => 'bacula-sd',
     saddr       => $bacula::public_addresses,