From b0439bf9b68d4e11a1511b289cba15ea10588d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 14 May 2018 00:52:33 +0200 Subject: Activate postgresql backup in production --- .../role/manifests/cryptoportfolio/postgresql_backup.pp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/role/manifests/cryptoportfolio/postgresql_backup.pp b/modules/role/manifests/cryptoportfolio/postgresql_backup.pp index c6ca0fa..5d937bd 100644 --- a/modules/role/manifests/cryptoportfolio/postgresql_backup.pp +++ b/modules/role/manifests/cryptoportfolio/postgresql_backup.pp @@ -14,7 +14,7 @@ class role::cryptoportfolio::postgresql_backup inherits role::backup { ensure_packages(["postgresql"]) - $pg_backup_hosts = ["cryptoportfolio-dev.immae.eu"] + $pg_backup_hosts = ["cryptoportfolio-dev.immae.eu", "cryptoportfolio.immae.eu"] $pg_backup_hosts.each |$pg_backup_host| { $pg_path = "$mountpoint/$pg_backup_host/postgresql" @@ -120,17 +120,19 @@ class role::cryptoportfolio::postgresql_backup inherits role::backup { postgresql_version => "10", } + $primary_conninfo = "host=$pg_host port=$pg_port user=$ldap_cn password=$ldap_password sslmode=require" + $primary_slot_name = regsubst($ldap_cn, '-', "_", "G") + $standby_mode = "on" + concat { "$pg_path/recovery.conf": owner => $pg_user, group => $pg_group, mode => '0640', warn => true, } - postgresql::server::recovery { "$pg_backup_host recovery": - primary_conninfo => "host=$pg_host port=$pg_port user=$ldap_cn password=$ldap_password sslmode=require", - primary_slot_name => regsubst($ldap_cn, '-', "_", "G"), - standby_mode => "on", - target => "$pg_path/recovery.conf", + concat::fragment { "$pg_path/recovery.conf": + target => "$pg_path/recovery.conf", + content => template('postgresql/recovery.conf.erb'), } file { "$pg_path/postgresql.conf": -- cgit v1.2.3