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'],
23 include postgres::backup_source
25 $pg_config_options = {
26 'track_counts' => 'yes',
27 'archive_mode' => 'yes',
28 'wal_level' => 'archive',
29 'max_wal_senders' => '3',
30 'archive_timeout' => '1h',
31 'archive_command' => '/usr/local/bin/pg-backup-file main WAL %p',
33 'ssl_cert_file' => '/etc/ssl/debian/certs/thishost-server.crt',
34 'ssl_key_file' => '/etc/ssl/private/thishost-server.key',
36 $pg_config_options.each |String $key, String $value| {
37 postgresql_conf { $key:
39 target => $postgresql::params::postgresql_conf_path,
40 notify => Service['postgresqld'],
44 postgres::backup_cluster { $::hostname:
45 pg_version => $postgresql::params::version,
46 pg_port => $postgresql::params::port,