]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/profile/manifests/postgresql/replication.pp
Try to restore postgresql backup at initialization
[perso/Immae/Projets/Puppet.git] / modules / profile / manifests / postgresql / replication.pp
index 2fcb71cda258727834f6699c4aa576d291dc8e64..b05005869d4863100263179b094065367a865b69 100644 (file)
@@ -52,6 +52,7 @@ define profile::postgresql::replication (
   if $handle_role {
     postgresql::server::role { $host_cn:
       replication => true,
+      require => Service["postgresql"],
     }
 
     if $add_self_role {
@@ -60,13 +61,15 @@ define profile::postgresql::replication (
       # Needed to be replicated to the backup and be able to recover later
       ensure_resource("postgresql::server::role", $ldap_cn, {
         replication => true,
+        require => Service["postgresql"],
       })
     }
   }
 
   if $handle_slot {
     postgresql_replication_slot { regsubst($host_cn, '-', "_", "G"):
-      ensure => present
+      ensure  => present,
+      require => Service["postgresql"],
     }
   }
 }