fd: also use the grep in public_addresses to learn if we support v4/v6
[mirror/dsa-puppet.git] / modules / bacula / manifests / storage.pp
index 874efec..0a445e0 100644 (file)
@@ -5,14 +5,15 @@
 # @param filestor_name    storage device media type name prefix
 # @param port_sd          port for the sd to listen on
 # @param storage_name     bacula name of this sd instance
+# @param storage_address  address of this sd instance that other instances should connect to (dns name)
 class bacula::storage (
   String $backup_path     = '/srv/bacula',
   String $filestor_device = 'FileStorage',
   String $filestor_name   = 'File',
   Integer $port_sd        = 9103,
   String $storage_name    = "${::fqdn}-sd",
+  Stdlib::Host $storage_address = $::fqdn,
 ) inherits bacula {
-  $storage_secret = hkdf('/etc/puppet/secret', "bacula-sd-${::fqdn}")
 
   package { 'bacula-sd':
     ensure => installed
@@ -54,7 +55,6 @@ class bacula::storage (
     purge   => true,
     force   => true,
     recurse => true,
-    source  => 'puppet:///files/empty/',
     notify  => Exec['bacula-sd restart-when-idle']
   }
 
@@ -64,7 +64,7 @@ class bacula::storage (
     port        => $port_sd,
     target      => 'bacula-sd',
   }
-  Ferm::Rule::Simple <<| tag == "bacula::director-to-storage::${bacula::bacula_director_address}" |>>;
+  Ferm::Rule::Simple <<| tag == 'bacula::director-to-storage' |>>;
   Ferm::Rule::Simple <<| tag == "bacula::fd-to-storage::${::fqdn}" |>>;
 
   file { '/etc/bacula/storage-conf.d/empty.conf':
@@ -87,5 +87,6 @@ class bacula::storage (
       | EOF
   }
 
+  Bacula::Storage::Director<<| tag == 'bacula::to-storage' |>>
   Bacula::Storage::Client<<| tag == "bacula::to-storage::${::fqdn}" |>>
 }