From: Peter Palfrader Date: Tue, 24 Sep 2019 06:34:39 +0000 (+0200) Subject: Make bacula DB a parameter and template variable again X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=commitdiff_plain;h=fef6fe13456346f5ab0c74ef870ee50f23c1607e Make bacula DB a parameter and template variable again --- diff --git a/data/common.yaml b/data/common.yaml index f5c4b7f03..78b055156 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -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/' diff --git a/modules/bacula/manifests/director.pp b/modules/bacula/manifests/director.pp index b4e0105a9..daa0d6ba0 100644 --- a/modules/bacula/manifests/director.pp +++ b/modules/bacula/manifests/director.pp @@ -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', diff --git a/modules/bacula/manifests/init.pp b/modules/bacula/manifests/init.pp index 76493880d..128063fbf 100644 --- a/modules/bacula/manifests/init.pp +++ b/modules/bacula/manifests/init.pp @@ -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', diff --git a/modules/bacula/templates/bacula-dir.conf.erb b/modules/bacula/templates/bacula-dir.conf.erb index d3835be4a..8d06dea3a 100644 --- a/modules/bacula/templates/bacula-dir.conf.erb +++ b/modules/bacula/templates/bacula-dir.conf.erb @@ -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";