d2443a187ad346769c32642ad93853fb1f5f0a6b
[mirror/dsa-puppet.git] / modules / postgres / manifests / backup_source.pp
1 #
2 # See dsa-wiki input/howto/postgres-backup.creole for some documentation
3 #
4 class postgres::backup_source {
5         file { "/usr/local/bin/pg-backup-file":
6                 mode    => '0555',
7                 source  => "puppet:///modules/roles/postgresql_server/pg-backup-file",
8         }
9         file { "/usr/local/bin/pg-receive-file-from-backup":
10                 mode    => '0555',
11                 source  => "puppet:///modules/roles/postgresql_server/pg-receive-file-from-backup",
12         }
13         file { "/etc/dsa/pg-backup-file.conf":
14                 content => template('roles/postgresql_server/pg-backup-file.conf.erb'),
15         }
16
17         ssh::keygen {'postgres': }
18
19
20         if $::hostname in [melartin, vittoria] {
21                 postgres::backup_cluster { $::hostname:
22                         pg_version => '9.6',
23                 }
24         }
25         if $::hostname in [buxtehude] {
26                 postgres::backup_cluster { $::hostname:
27                         pg_version => '11',
28                         pg_port => 5433,
29                 }
30                 postgres::backup_cluster { "${::hostname}-debbugs":
31                         pg_version => '11',
32                         pg_port => 5441,
33                         pg_cluster => 'debbugs',
34                 }
35         }
36         if $::hostname in [danzi] {
37                 postgres::backup_cluster { $::hostname:
38                         pg_version => '9.6',
39                         pg_port => 5433,
40                 }
41                 postgres::backup_cluster { "${::hostname}-debconf":
42                         pg_version => '9.6',
43                         pg_port => 5434,
44                         pg_cluster => 'debconf',
45                 }
46         }
47
48         if $::hostname in [postgresql-manda-01] {
49                 postgres::backup_cluster { "${::hostname}-bacula":
50                         pg_version => '11',
51                         pg_port => 5432,
52                         pg_cluster => 'bacula',
53                 }
54         }
55
56         if $::hostname in [melartin, vittoria, godard, buxtehude, danzi, postgresql-manda-01] {
57                 postgres::backup_server::register_backup_clienthost { "backup-clienthost-${::fqdn}}":
58                 }
59         }
60
61 }