From a5d122b99b89ba755fd0932dd35c82babd2d31bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Tue, 14 Nov 2017 17:18:39 -0500 Subject: [PATCH] add: make postgresql write archives Change-Id: I6ab6b8730f93f2d7b7e4593797ffe6601226f0ec --- .../production/manifests/postgres-primary.pp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/environments/production/manifests/postgres-primary.pp b/environments/production/manifests/postgres-primary.pp index 076c4a8..c1f015a 100644 --- a/environments/production/manifests/postgres-primary.pp +++ b/environments/production/manifests/postgres-primary.pp @@ -43,4 +43,27 @@ node postgres-primary { address => "${ips[quiz]}/32", auth_method => 'md5', } + postgresql::server::pg_hba_rule{'allow local replication by postgres': + #local replication postgres ident + type => 'local', + database => 'replication', + user => 'postgres', + auth_method => 'ident' + } + postgresql_conf{'archive_mode': + target => '/etc/postgresql/9.6/main/postgresql.conf', + value => 'on' + } + file{'/var/lib/postgresql/archive/': + ensure => 'directory', + owner => 'postgres' + } -> + postgresql_conf{'archive_command': + target => '/etc/postgresql/9.6/main/postgresql.conf', + value => 'test ! -f /var/lib/postgresql/archive/%f && cp %p /var/lib/postgresql/archive/%f' + } + postgresql_conf{'wal_level': + target => '/etc/postgresql/9.6/main/postgresql.conf', + value => 'replica' + } } -- 2.39.2