From: Peter Palfrader Date: Tue, 24 Sep 2019 21:04:27 +0000 (+0200) Subject: Make director_secret for bconsole something local to the director class X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=21657d292015274ef9ab7619d2214e65998ccb69;p=mirror%2Fdsa-puppet.git Make director_secret for bconsole something local to the director class --- diff --git a/modules/bacula/manifests/director.pp b/modules/bacula/manifests/director.pp index c1f6c38b4..8c9791698 100644 --- a/modules/bacula/manifests/director.pp +++ b/modules/bacula/manifests/director.pp @@ -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}" diff --git a/modules/bacula/manifests/init.pp b/modules/bacula/manifests/init.pp index 51fe0e12d..598bd6575 100644 --- a/modules/bacula/manifests/init.pp +++ b/modules/bacula/manifests/init.pp @@ -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}"), diff --git a/modules/bacula/templates/bacula-dir.conf.erb b/modules/bacula/templates/bacula-dir.conf.erb index dbcc8fe45..5d512e643 100644 --- a/modules/bacula/templates/bacula-dir.conf.erb +++ b/modules/bacula/templates/bacula-dir.conf.erb @@ -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 diff --git a/modules/bacula/templates/bconsole.conf.erb b/modules/bacula/templates/bconsole.conf.erb index 183dd531d..8eeb3e5e8 100644 --- a/modules/bacula/templates/bconsole.conf.erb +++ b/modules/bacula/templates/bconsole.conf.erb @@ -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