X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Frole%2Fmanifests%2Fcryptoportfolio.pp;h=1738685825e397f5c81c4472ad2e40982eb95ad3;hb=4e8486c1a0453209043480eaf8b5769e70864420;hp=2755fee82934e133ba9715c6ce5fa9ab787bc388;hpb=57ae81eaeb85a2892f1afe07ea5be1917f64d065;p=perso%2FImmae%2FProjets%2FPuppet.git diff --git a/modules/role/manifests/cryptoportfolio.pp b/modules/role/manifests/cryptoportfolio.pp index 2755fee..1738685 100644 --- a/modules/role/manifests/cryptoportfolio.pp +++ b/modules/role/manifests/cryptoportfolio.pp @@ -1,14 +1,48 @@ -class role::cryptoportfolio { +class role::cryptoportfolio ( + String $user, + String $group, + String $home, + Optional[String] $env = "prod", + Optional[String] $webhook_url = undef, + String $pg_user, + String $pg_db, + Optional[String] $pg_hostname = "/run/postgresql", + Optional[String] $pg_port = "5432", + Optional[String] $redis_host = "/run/redis/redis.sock", + Optional[String] $smtp_login = undef, + Optional[String] $smtp_password = undef, + Optional[String] $smtp_host = undef, + Optional[String] $mail_from = undef, + Optional[String] $web_host = undef, + Optional[String] $web_port = "", + Optional[Boolean] $web_ssl = true, + Optional[String] $front_version = undef, + Optional[String] $front_sha256 = undef, + Optional[String] $trader_version = undef, + Optional[String] $trader_sha256 = undef, +) { include "base_installation" + include "profile::tools" include "profile::postgresql" + include "profile::apache" + include "profile::xmr_stak" + include "profile::boinc" + include "profile::monitoring" - $password_seed = lookup("base_installation::puppet_pass_seed") |$key| { {} } + contain "role::cryptoportfolio::postgresql" + contain "role::cryptoportfolio::apache" - postgresql::server::db { 'cryptoportfolio': - user => 'cryptoportfolio', - password => postgresql_password('cryptoportfolio', generate_password(24, $password_seed, "postgres_cryptoportfolio")), + contain "role::cryptoportfolio::notify" + + unless empty($trader_version) { + if versioncmp($trader_version, "v1.3") >= 0 { + include "profile::redis" + } + contain "role::cryptoportfolio::bot" } - ensure_packages("go") + unless empty($front_version) { + contain "role::cryptoportfolio::front" + } }