2 class salsa::database inherits salsa {
3 class { 'postgresql::globals':
6 class { 'postgresql::server':
7 listen_addresses => '*',
9 class { 'postgresql::server::contrib': }
11 postgresql::server::db { $salsa::db_name:
12 user => $salsa::db_role,
13 password => postgresql_password($salsa::db_role, $salsa::db_password),
16 postgresql::server::extension { 'pg_trgm':
17 database => $salsa::db_name,
18 require => Class['postgresql::server::contrib'],
21 $pg_config_options = {
22 'track_counts' => 'yes',
23 'archive_mode' => 'yes',
24 'wal_level' => 'archive',
25 'max_wal_senders' => '3',
26 'archive_timeout' => '1h',
27 'archive_command' => '/usr/local/bin/pg-backup-file main WAL %p',
29 'ssl_cert_file' => '/etc/ssl/debian/certs/thishost-server.crt',
30 'ssl_key_file' => '/etc/ssl/private/thishost-server.key',
32 $pg_config_options.each |String $key, String $value| {
33 postgresql_conf { $key:
35 target => $postgresql::params::postgresql_conf_path,
36 notify => Service['postgresqld'],
40 include postgres::backup_source
42 postgres::backup_cluster { $::hostname:
43 pg_version => $postgresql::params::version,
44 pg_port => $postgresql::params::port,
49 postgres::backup_server::register_backup_clienthost { "backup-clienthost-${::fqdn}}":