From 808f822507d47cc6e47da41e206ff9b942b506df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 14 May 2018 01:12:04 +0200 Subject: [PATCH] Move postgresql replication to its right place --- modules/role/manifests/backup.pp | 3 ++- .../postgresql_backup.pp => backup/postgresql.pp} | 8 ++++---- .../postgresql.conf.erb} | 0 .../postgresql_backup@.service.erb | 0 4 files changed, 6 insertions(+), 5 deletions(-) rename modules/role/manifests/{cryptoportfolio/postgresql_backup.pp => backup/postgresql.pp} (94%) rename modules/role/templates/{cryptoportfolio/postgresql_backup.conf.erb => backup/postgresql.conf.erb} (100%) rename modules/role/templates/{cryptoportfolio => backup}/postgresql_backup@.service.erb (100%) 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 -- 2.41.0