]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/commitdiff
Move postgresql replication to its right place
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 13 May 2018 23:12:04 +0000 (01:12 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 13 May 2018 23:14:03 +0000 (01:14 +0200)
modules/role/manifests/backup.pp
modules/role/manifests/backup/postgresql.pp [moved from modules/role/manifests/cryptoportfolio/postgresql_backup.pp with 94% similarity]
modules/role/templates/backup/postgresql.conf.erb [moved from modules/role/templates/cryptoportfolio/postgresql_backup.conf.erb with 100% similarity]
modules/role/templates/backup/postgresql_backup@.service.erb [moved from modules/role/templates/cryptoportfolio/postgresql_backup@.service.erb with 100% similarity]

index 37e6138ef0ddd64ca1a55ef88e8f3226c7450c81..b35c54270fbe2f573700ab782840fe10e32653b0 100644 (file)
@@ -14,7 +14,8 @@ class role::backup (
   include "profile::xmr_stak"
   include "profile::known_hosts"
   include "profile::boinc"
-  include "role::cryptoportfolio::postgresql_backup"
+
+  include "role::backup::postgresql"
 
   ensure_packages(["rsync"])
 
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"),
   }
 }