- '2a01:3f0:0:27::24'
- '2a01:3f0:0:28::25'
postgres::backup_cluster::db_backup_role: 'debian-backup'
+postgres::backup_server::global::backup_unix_user: 'debbackup'
# bacula
#
bacula::email_all: 'bacula-reports@admin.debian.org'
}
file { '/var/lib/dsa/postgres-make-base-backups':
ensure => directory,
- owner => 'debbackup',
+ owner => $postgres::backup_server::globals::backup_unix_user,
mode => '0755',
}
concat::fragment { 'puppet-crontab--postgres-make_base_backups':
target => '/etc/cron.d/puppet-crontab',
content => @("EOF")
- */30 * * * * debbackup sleep $(( RANDOM \% 1200 )); chronic ${make_base_backups}
+ */30 * * * * ${postgres::backup_server::globals::backup_unix_user} sleep $(( RANDOM \% 1200 )); chronic ${make_base_backups}
| EOF
}
# Maintain .pgpass file on backup servers
# #
concat { $postgres::backup_server::globals::pgpassfile:
- owner => 'debbackup',
- group => 'debbackup',
+ owner => $postgres::backup_server::globals::backup_unix_user,
+ group => $postgres::backup_server::globals::backup_unix_group,
mode => '0400'
}
- concat::fragment{ 'pgpass-local':
- target => $postgres::backup_server::globals::pgpassfile,
- source => '/home/debbackup/.pgpass-local',
- order => '00'
- }
Concat::Fragment <<| tag == $postgres::backup_server::globals::tag_source_pgpassline |>>
}
# Global definitions for the postgres::backup_server setup
#
+# @param backup_unix_user unix user on the backup host
+# @param backup_unix_group group of unix user on the backup host
# @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 $backup_unix_user,
+ String $backup_unix_group = $backup_unix_user,
+ String $pgpassfile = "/home/${backup_unix_user}/.pgpass",
String $sshkeys_sources = '/etc/dsa/postgresql-backup/sshkeys-sources',
String $base_backup_clusters = '/etc/dsa/postgresql-backup/base-backup-clusters',
) {
set -u
if [ "$(id -u)" = 0 ]; then
- echo >&2 "Do not run me as root. Probably you want sudo -u debbackup."
+ echo >&2 "Do not run me as root. Probably you want sudo -u <%= @backup_unix_user %>."
exit 1
fi
# edit with visudo!
-nagios ALL=(debbackup) NOPASSWD: /usr/lib/nagios/plugins/dsa-check-backuppg ""
+nagios ALL=(<%= @backup_unix_user %>) NOPASSWD: /usr/lib/nagios/plugins/dsa-check-backuppg ""
using exim::vdomain
- move the postgres::backup_server stuff out of the salsa/database manifest
+
+- postgres/templates/backup_source/pg-backup-file.conf.erb:
+ get username from params, hosts from rolehosts