Make bacula DB a parameter and template variable again
authorPeter Palfrader <peter@palfrader.org>
Tue, 24 Sep 2019 06:34:39 +0000 (08:34 +0200)
committerPeter Palfrader <peter@palfrader.org>
Tue, 24 Sep 2019 06:34:39 +0000 (08:34 +0200)
data/common.yaml
modules/bacula/manifests/director.pp
modules/bacula/manifests/init.pp
modules/bacula/templates/bacula-dir.conf.erb

index f5c4b7f..78b0551 100644 (file)
@@ -7,14 +7,14 @@ lookup_options:
   apt::sources::debian::location:
     merge: unique
 
-# class parameters
+# == class parameters
+#####################
 resolv::nameservers: []
 resolv::searchpaths: ['debian.org']
 staticsync::user: 'staticsync'
 staticsync::basedir: '/srv/static.debian.org'
 exim::smarthost: 'mailout.debian.org'
 postfix::smarthost: 'mailout.debian.org'
-
 roles::dns_primary::allow_access:
   # easydns
   - '64.68.200.91'
@@ -30,8 +30,14 @@ roles::dns_primary::allow_access:
   - '194.146.105.25'
   - '2a01:3f0:0:27::24'
   - '2a01:3f0:0:28::25'
+# bacula
+#
+bacula::director::bacula_db_address: 'postgresql-manda-01.debian.org'
+bacula::director::bacula_db_port:    5432
+
 
-# other variables
+# == other variables
+#####################
 allow_dns_query: []
 role_config__mirrors:
   mirror_basedir_prefix: '/srv/mirrors/'
index b4e0105..daa0d6b 100644 (file)
@@ -1,5 +1,11 @@
 # our bacula director
-class bacula::director inherits bacula {
+#
+# @param bacula_db_address hostname of the postgres server for the catalog DB
+# @param bacula_db_port    port of the postgres server for the catalog DB
+class bacula::director(
+  String  $bacula_db_address = 'postgresql-manda-01.debian.org',
+  Integer $bacula_db_port    = 5432,
+) inherits bacula {
 
   ensure_packages ( [
     'bacula-director-pgsql',
index 7649388..128063f 100644 (file)
@@ -16,8 +16,6 @@ class bacula (
   String  $bacula_storage_address     = 'storace.debian.org',
   Integer $bacula_storage_port        = 9103,
   Integer $bacula_client_port         = 9102,
-  String  $bacula_db_address          = 'danzi.debian.org',
-  Integer $bacula_db_port             = 5433,
 
   String  $bacula_backup_path         = '/srv/bacula',
 
index d3835be..8d06dea 100644 (file)
@@ -124,8 +124,8 @@ Schedule {
 Catalog {
   Name = MyCatalog
   dbname = bacula;
-  dbport = 5432;
-  dbaddress = postgresql-manda-01.debian.org;
+  dbport = <%= @bacula_db_port %>;
+  dbaddress =  <%= @bacula_db_address %>;
   dbsslmode = verify-ca;
   dbsslca = /etc/ssl/debian/certs/ca.crt;
   dbuser = "bacula";