aboutsummaryrefslogtreecommitdiff
path: root/modules/role
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-05-14 00:52:33 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-05-14 00:56:51 +0200
commitb0439bf9b68d4e11a1511b289cba15ea10588d8d (patch)
treeea4733b196f1b90b021dd22f730aa298bb2b0a33 /modules/role
parenta87d847bf496e64b10e515866bcfd86dfeb6ffa4 (diff)
downloadPuppet-b0439bf9b68d4e11a1511b289cba15ea10588d8d.tar.gz
Puppet-b0439bf9b68d4e11a1511b289cba15ea10588d8d.tar.zst
Puppet-b0439bf9b68d4e11a1511b289cba15ea10588d8d.zip
Activate postgresql backup in production
Diffstat (limited to 'modules/role')
-rw-r--r--modules/role/manifests/cryptoportfolio/postgresql_backup.pp14
1 files 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 {
14 14
15 ensure_packages(["postgresql"]) 15 ensure_packages(["postgresql"])
16 16
17 $pg_backup_hosts = ["cryptoportfolio-dev.immae.eu"] 17 $pg_backup_hosts = ["cryptoportfolio-dev.immae.eu", "cryptoportfolio.immae.eu"]
18 18
19 $pg_backup_hosts.each |$pg_backup_host| { 19 $pg_backup_hosts.each |$pg_backup_host| {
20 $pg_path = "$mountpoint/$pg_backup_host/postgresql" 20 $pg_path = "$mountpoint/$pg_backup_host/postgresql"
@@ -120,17 +120,19 @@ class role::cryptoportfolio::postgresql_backup inherits role::backup {
120 postgresql_version => "10", 120 postgresql_version => "10",
121 } 121 }
122 122
123 $primary_conninfo = "host=$pg_host port=$pg_port user=$ldap_cn password=$ldap_password sslmode=require"
124 $primary_slot_name = regsubst($ldap_cn, '-', "_", "G")
125 $standby_mode = "on"
126
123 concat { "$pg_path/recovery.conf": 127 concat { "$pg_path/recovery.conf":
124 owner => $pg_user, 128 owner => $pg_user,
125 group => $pg_group, 129 group => $pg_group,
126 mode => '0640', 130 mode => '0640',
127 warn => true, 131 warn => true,
128 } 132 }
129 postgresql::server::recovery { "$pg_backup_host recovery": 133 concat::fragment { "$pg_path/recovery.conf":
130 primary_conninfo => "host=$pg_host port=$pg_port user=$ldap_cn password=$ldap_password sslmode=require", 134 target => "$pg_path/recovery.conf",
131 primary_slot_name => regsubst($ldap_cn, '-', "_", "G"), 135 content => template('postgresql/recovery.conf.erb'),
132 standby_mode => "on",
133 target => "$pg_path/recovery.conf",
134 } 136 }
135 137
136 file { "$pg_path/postgresql.conf": 138 file { "$pg_path/postgresql.conf":