From: Ismaƫl Bouya Date: Sun, 13 May 2018 23:12:04 +0000 (+0200) Subject: Move postgresql replication to its right place X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=808f822507d47cc6e47da41e206ff9b942b506df;p=perso%2FImmae%2FProjets%2FPuppet.git Move postgresql replication to its right place --- diff --git a/modules/role/manifests/backup.pp b/modules/role/manifests/backup.pp index 37e6138..b35c542 100644 --- a/modules/role/manifests/backup.pp +++ b/modules/role/manifests/backup.pp @@ -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"]) diff --git a/modules/role/manifests/cryptoportfolio/postgresql_backup.pp b/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 5d937bd..59e4669 100644 --- a/modules/role/manifests/cryptoportfolio/postgresql_backup.pp +++ b/modules/role/manifests/backup/postgresql.pp @@ -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"), } } diff --git a/modules/role/templates/cryptoportfolio/postgresql_backup.conf.erb b/modules/role/templates/backup/postgresql.conf.erb similarity index 100% rename from modules/role/templates/cryptoportfolio/postgresql_backup.conf.erb rename to modules/role/templates/backup/postgresql.conf.erb diff --git a/modules/role/templates/cryptoportfolio/postgresql_backup@.service.erb b/modules/role/templates/backup/postgresql_backup@.service.erb similarity index 100% rename from modules/role/templates/cryptoportfolio/postgresql_backup@.service.erb rename to modules/role/templates/backup/postgresql_backup@.service.erb