1 node postgres-primary {
2 include container::contained
3 include container::no_ssh
7 install_options => ['--no-install-recommends'],
10 class { 'postgresql::globals':
13 class { 'postgresql::server':
14 listen_addresses => '*',
16 postgresql::server::db { 'gigi':
17 require => Package['postgresql'],
19 password => postgresql_password('gigi', $passwords[postgres][gigi]),
21 $gigi_ip = $ips[gigi];
22 postgresql::server::pg_hba_rule { 'allow gigi to access its database':
23 require => Package['postgresql'],
24 description => "Open up PostgreSQL for access from gigi to its database",
28 address => "$gigi_ip/32",
32 postgresql::server::db { 'quiz':
33 require => Class['postgresql::server'],
35 password => postgresql_password('quiz', $passwords[postgres][quiz]),
37 postgresql::server::pg_hba_rule { 'allow quiz to access its database':
38 require => Package['postgresql'],
39 description => "Open up PostgreSQL for access from quiz to its database",
43 address => "${ips[quiz]}/32",
46 postgresql::server::pg_hba_rule{'allow local replication by postgres':
47 #local replication postgres ident
49 database => 'replication',
51 auth_method => 'ident'
53 postgresql_conf{'archive_mode':
54 target => '/etc/postgresql/9.6/main/postgresql.conf',
57 file{'/var/lib/postgresql/archive/':
58 ensure => 'directory',
61 postgresql_conf{'archive_command':
62 target => '/etc/postgresql/9.6/main/postgresql.conf',
63 value => 'test ! -f /var/lib/postgresql/archive/%f && cp %p /var/lib/postgresql/archive/%f'
65 postgresql_conf{'wal_level':
66 target => '/etc/postgresql/9.6/main/postgresql.conf',