Correctly add tracker and wanna-build backups @ danzi
[mirror/dsa-puppet.git] / modules / postgres / manifests / backup_source.pp
index d67f675..363c890 100644 (file)
@@ -14,12 +14,7 @@ class postgres::backup_source {
                content => template('roles/postgresql_server/pg-backup-file.conf.erb'),
        }
 
-       if ! $::postgres_key {
-               exec { 'create-postgres-key':
-                       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\'',
-                       onlyif  => '/usr/bin/getent passwd postgres > /dev/null && ! [ -e /var/lib/postgresql/.ssh/id_rsa ]'
-               }
-       }
+       ssh::keygen {'postgres': }
 
 
        if $::hostname in [melartin, vittoria] {
@@ -43,15 +38,34 @@ class postgres::backup_source {
                        pg_version => '9.6',
                        pg_port => 5433,
                }
+               postgres::backup_cluster { "${::hostname}-tracker":
+                       pg_version => '9.6',
+                       pg_port => 5432,
+                       pg_cluster => 'tracker',
+               }
                postgres::backup_cluster { "${::hostname}-debconf":
                        pg_version => '9.6',
                        pg_port => 5434,
                        pg_cluster => 'debconf',
                }
+               postgres::backup_cluster { "${::hostname}-wannabuild":
+                       pg_version => '9.6',
+                       pg_port => 5436,
+                       pg_cluster => 'wannabuild',
+               }
        }
 
-       if $::hostname in [melartin, vittoria, godard, buxtehude, danzi] {
+       if $::hostname in [postgresql-manda-01] {
+               postgres::backup_cluster { "${::hostname}-bacula":
+                       pg_version => '11',
+                       pg_port => 5432,
+                       pg_cluster => 'bacula',
+               }
+       }
+
+       if $::hostname in [melartin, vittoria, godard, buxtehude, danzi, postgresql-manda-01] {
                postgres::backup_server::register_backup_clienthost { "backup-clienthost-${::fqdn}}":
                }
        }
+
 }