Make director_secret for bconsole something local to the director class
authorPeter Palfrader <peter@palfrader.org>
Tue, 24 Sep 2019 21:04:27 +0000 (23:04 +0200)
committerPeter Palfrader <peter@palfrader.org>
Tue, 24 Sep 2019 21:04:27 +0000 (23:04 +0200)
modules/bacula/manifests/director.pp
modules/bacula/manifests/init.pp
modules/bacula/templates/bacula-dir.conf.erb
modules/bacula/templates/bconsole.conf.erb

index c1f6c38..8c97916 100644 (file)
@@ -17,6 +17,8 @@ class bacula::director(
   Optional[String] $db_sslca = undef,
 ) inherits bacula {
 
+  # used by e.g. bconsole
+  $director_secret = hkdf('/etc/puppet/secret', "bacula-dir-${::hostname}")
   # the RestoreFiles Job needs a Pool.  Any valid pool.
   $some_pool_name = "poolfull-${pool_name}-${bacula::bacula_director_address}"
 
index 51fe0e1..598bd65 100644 (file)
@@ -11,7 +11,6 @@ class bacula (
   String  $bacula_director_address    = 'dinis.debian.org',
   String  $bacula_storage_address     = 'storace.debian.org',
 
-  String  $bacula_director_secret     = hkdf('/etc/puppet/secret', "bacula-dir-${::hostname}"),
   String  $bacula_db_secret           = hkdf('/etc/puppet/secret', "bacula-db-${::hostname}"),
   String  $bacula_client_secret       = hkdf('/etc/puppet/secret', "bacula-fd-${::fqdn}"),
   String  $bacula_monitor_secret      = hkdf('/etc/puppet/secret', "bacula-monitor-${bacula_director_name}"),
index dbcc8fe..5d512e6 100644 (file)
@@ -16,7 +16,7 @@ Director {
   WorkingDirectory = "/var/lib/bacula"
   PidDirectory = "/run/bacula"
   Maximum Concurrent Jobs = 20
-  Password = "<%= @bacula_director_secret %>"
+  Password = "<%= @director_secret %>"
   Messages = Daemon
   DirAddresses = {
      # Always have localhost in, then the configured IP
index 183dd53..8eeb3e5 100644 (file)
@@ -8,9 +8,9 @@
 
 Director {
   Name = <%= @bacula_director_name %>
-  DIRport = 9101
+  DIRport = <%= @port_dir %>
   address = <%= @bacula_director_address %>
-  Password = "<%= @bacula_director_secret %>"
+  Password = "<%= @director_secret %>"
 
   TLS Enable = yes
   TLS Require = yes