From: Peter Palfrader Date: Sat, 28 Sep 2019 18:14:21 +0000 (+0200) Subject: Move $make_base_backups to postgres::backup_server as it is local there; make some... X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=57eef5a4db8253d8583977b82772b881c0ffbb16;p=mirror%2Fdsa-puppet.git Move $make_base_backups to postgres::backup_server as it is local there; make some strings in postgres::backup_server::globals parameters --- diff --git a/modules/postgres/manifests/backup_server.pp b/modules/postgres/manifests/backup_server.pp index 1607db502..de45f72f8 100644 --- a/modules/postgres/manifests/backup_server.pp +++ b/modules/postgres/manifests/backup_server.pp @@ -2,6 +2,8 @@ class postgres::backup_server { include postgres::backup_server::globals + $make_base_backups = '/usr/local/bin/postgres-make-base-backups' + ensure_packages ( [ 'libhash-merge-simple-perl', 'libyaml-perl', @@ -21,7 +23,7 @@ class postgres::backup_server { } Concat::Fragment <<| tag == $postgres::backup_server::globals::tag_base_backup |>> - file { $postgres::backup_server::globals::make_base_backups: + file { $make_base_backups: mode => '0555', content => template('postgres/backup_server/postgres-make-base-backups.erb'), } @@ -33,7 +35,7 @@ class postgres::backup_server { concat::fragment { 'puppet-crontab--postgres-make_base_backups': target => '/etc/cron.d/puppet-crontab', content => @("EOF") - */30 * * * * debbackup sleep $(( RANDOM \% 1200 )); chronic ${$postgres::backup_server::globals::make_base_backups} + */30 * * * * debbackup sleep $(( RANDOM \% 1200 )); chronic ${make_base_backups} | EOF } diff --git a/modules/postgres/manifests/backup_server/globals.pp b/modules/postgres/manifests/backup_server/globals.pp index b9713730d..bdac82221 100644 --- a/modules/postgres/manifests/backup_server/globals.pp +++ b/modules/postgres/manifests/backup_server/globals.pp @@ -1,10 +1,12 @@ +# Global definitions for the postgres::backup_server setup # -class postgres::backup_server::globals { - $pgpassfile = '/home/debbackup/.pgpass' - $sshkeys_sources = '/etc/dsa/postgresql-backup/sshkeys-sources' - $make_base_backups = '/usr/local/bin/postgres-make-base-backups' - $base_backup_clusters = '/etc/dsa/postgresql-backup/base-backup-clusters' - +# @param pgpassfile pg password file for pg_basebackup runs +# @param base_backup_clusters where to store the list of clusters to make base backups of +class postgres::backup_server::globals( + String $pgpassfile = '/home/debbackup/.pgpass', + String $sshkeys_sources = '/etc/dsa/postgresql-backup/sshkeys-sources', + String $base_backup_clusters = '/etc/dsa/postgresql-backup/base-backup-clusters', +) { $tag_base_backup = 'postgresql::server::backup-source-make-base-backup-entry' $tag_source_sshkey = 'postgresql::server::backup-source-sshkey' $tag_source_pgpassline = 'postgresql::server::backup-source-pgpassline'