]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/role/manifests/backup/postgresql.pp
Move postgresql replication to its right place
[perso/Immae/Projets/Puppet.git] / modules / role / manifests / backup / postgresql.pp
similarity index 94%
rename from modules/role/manifests/cryptoportfolio/postgresql_backup.pp
rename to modules/role/manifests/backup/postgresql.pp
index 5d937bdf56d70e7617b43c65b10893e7579058ab..59e4669296e44f0509a44568b79d59627a49107e 100644 (file)
@@ -1,4 +1,4 @@
-class role::cryptoportfolio::postgresql_backup inherits role::backup {
+class role::backup::postgresql inherits role::backup {
   # This manifest is supposed to be part of the backup server
 
   $password_seed = lookup("base_installation::puppet_pass_seed")
@@ -14,7 +14,7 @@ class role::cryptoportfolio::postgresql_backup inherits role::backup {
 
   ensure_packages(["postgresql"])
 
-  $pg_backup_hosts = ["cryptoportfolio-dev.immae.eu", "cryptoportfolio.immae.eu"]
+  $pg_backup_hosts = lookup("role::backup::postgresql::backup_hosts", { "default_value" => [] })
 
   $pg_backup_hosts.each |$pg_backup_host| {
     $pg_path = "$mountpoint/$pg_backup_host/postgresql"
@@ -139,7 +139,7 @@ class role::cryptoportfolio::postgresql_backup inherits role::backup {
       owner   => $pg_user,
       group   => $pg_group,
       mode    => '0640',
-      content => template("role/cryptoportfolio/postgresql_backup.conf.erb"),
+      content => template("role/backup/postgresql.conf.erb"),
     }
 
     service { "postgresql_backup@$pg_backup_host":
@@ -158,6 +158,6 @@ class role::cryptoportfolio::postgresql_backup inherits role::backup {
     mode    => "0644",
     owner   => "root",
     group   => "root",
-    content => template("role/cryptoportfolio/postgresql_backup@.service.erb"),
+    content => template("role/backup/postgresql_backup@.service.erb"),
   }
 }