2 # See dsa-wiki input/howto/postgres-backup.creole for some documentation
4 class postgres::backup_source {
5 file { "/usr/local/bin/pg-backup-file":
7 source => "puppet:///modules/roles/postgresql_server/pg-backup-file",
9 file { "/usr/local/bin/pg-receive-file-from-backup":
11 source => "puppet:///modules/roles/postgresql_server/pg-receive-file-from-backup",
13 file { "/etc/dsa/pg-backup-file.conf":
14 content => template('roles/postgresql_server/pg-backup-file.conf.erb'),
17 if ! $::postgresql_key {
18 exec { 'create-postgresql-key':
19 command => '/bin/su - postgres -c \'mkdir -p -m 02700 .ssh && ssh-keygen -C "`whoami`@`hostname` (`date +%Y-%m-%d`)" -P "" -f .ssh/id_rsa -q\'',
20 onlyif => '/usr/bin/getent passwd postgres > /dev/null && ! [ -e /var/lib/postgresql/.ssh/id_rsa ]'
25 if $::hostname in [melartin, vittoria] {
26 postgres::backup_cluster { $::hostname:
30 if $::hostname in [buxtehude] {
31 postgres::backup_cluster { $::hostname:
35 postgres::backup_cluster { "${::hostname}-debbugs":
38 pg_cluster => 'debbugs',
41 if $::hostname in [danzi] {
42 postgres::backup_cluster { $::hostname:
46 postgres::backup_cluster { "${::hostname}-debconf":
49 pg_cluster => 'debconf',
53 if $::hostname in [melartin, vittoria, godard, buxtehude, danzi] {
54 postgres::backup_server::register_backup_clienthost { "backup-clienthost-${::fqdn}}":