]> WPIA git - infra.git/commitdiff
add: make postgresql write archives
authorFelix Dörre <felix@dogcraft.de>
Tue, 14 Nov 2017 22:18:39 +0000 (17:18 -0500)
committerFelix Dörre <felix@dogcraft.de>
Sun, 3 Dec 2017 12:54:03 +0000 (13:54 +0100)
Change-Id: I6ab6b8730f93f2d7b7e4593797ffe6601226f0ec

environments/production/manifests/postgres-primary.pp

index 076c4a8323405c4d1665b65c6ae4888adb5bce0f..c1f015aa7425f3af8522dd693916abf944f88ca1 100644 (file)
@@ -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'
+  }
 }