From: Peter Palfrader Date: Tue, 24 Sep 2019 21:00:28 +0000 (+0200) Subject: Make bacula_director_port something local to the director class X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=2711ddcacd35d9ff6a262b263babd27d7f6c06d6;p=mirror%2Fdsa-puppet.git Make bacula_director_port something local to the director class --- diff --git a/modules/bacula/manifests/client.pp b/modules/bacula/manifests/client.pp index 9ac5acb4e..6091786ff 100644 --- a/modules/bacula/manifests/client.pp +++ b/modules/bacula/manifests/client.pp @@ -21,7 +21,7 @@ class bacula::client( if $ensure == 'present' { @@bacula::director::client { $::fqdn: port_fd => $port_fd, - client => $::fqdn, + client => $::fqdn, tag => "bacula::to-director::${director_server}", } diff --git a/modules/bacula/manifests/director.pp b/modules/bacula/manifests/director.pp index c86839821..c1f6c38b4 100644 --- a/modules/bacula/manifests/director.pp +++ b/modules/bacula/manifests/director.pp @@ -5,6 +5,7 @@ # @param db_port port of the postgres server for the catalog DB # @param db_name DB name for the catalog DB # @param db_user username for the postgres server for the catalog DB +# @param port_dir Port that the director should listen on # @param db_sslca SSL CA store for DB access class bacula::director( String $db_address, @@ -12,6 +13,7 @@ class bacula::director( String $db_name = 'bacula', String $db_user = 'bacula', String $pool_name = 'bacula', + Integer $port_dir = 9101, Optional[String] $db_sslca = undef, ) inherits bacula { diff --git a/modules/bacula/manifests/director/client.pp b/modules/bacula/manifests/director/client.pp index 402a99708..0dddd271e 100644 --- a/modules/bacula/manifests/director/client.pp +++ b/modules/bacula/manifests/director/client.pp @@ -5,7 +5,7 @@ # @param port_fd port that this node's bacula-fd is listening on # @param client The name of the client (relevant for device names, media type names, etc.) define bacula::director::client ( - Integer $port_fd = 9102, + Integer $port_fd, String $client = $name, ) { include bacula::director diff --git a/modules/bacula/manifests/init.pp b/modules/bacula/manifests/init.pp index 1074c75c6..51fe0e12d 100644 --- a/modules/bacula/manifests/init.pp +++ b/modules/bacula/manifests/init.pp @@ -9,7 +9,6 @@ class bacula ( String $bacula_monitor_name = 'debian-mon', String $bacula_director_address = 'dinis.debian.org', - Integer $bacula_director_port = 9101, String $bacula_storage_address = 'storace.debian.org', String $bacula_director_secret = hkdf('/etc/puppet/secret', "bacula-dir-${::hostname}"), diff --git a/modules/bacula/templates/bacula-dir.conf.erb b/modules/bacula/templates/bacula-dir.conf.erb index 80aef43e5..dbcc8fe45 100644 --- a/modules/bacula/templates/bacula-dir.conf.erb +++ b/modules/bacula/templates/bacula-dir.conf.erb @@ -20,8 +20,8 @@ Director { Messages = Daemon DirAddresses = { # Always have localhost in, then the configured IP - ip = { addr = 127.0.0.1; port = 9101 } - ip = { addr = <%=@bacula_director_address%>; port = <%=@bacula_director_port%> } + ip = { addr = 127.0.0.1; port = <%= @port_dir %> } + ip = { addr = <%=@bacula_director_address%>; port = <%= @port_dir %> } } TLS Enable = yes