]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/commitdiff
Update bot and add database connection
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 25 Feb 2018 17:14:36 +0000 (18:14 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 25 Feb 2018 17:28:29 +0000 (18:28 +0100)
environments/production/data/nodes/vps494082.yaml
modules/role/manifests/cryptoportfolio.pp
modules/role/templates/cryptoportfolio/bot_config.ini.erb [new file with mode: 0644]

index 59b2447100bac1d711261318a12bdbadae41f01c..8cba9a224f9401fe2e41383bd1f302e1fe6b3792 100644 (file)
@@ -1,5 +1,5 @@
 base_installation::system_hostname: cryptoportfolio.immae.eu
 cryptoportfolio::front_version: v0.0.1-2-g989fb5c
 cryptoportfolio::front_sha256: 1e82044b6a40b415913658bb1b896087d8c2c43d64c5862cd84f60804f5854dc
-cryptoportfolio::bot_version: v0.1
-cryptoportfolio::bot_sha256: bb974d6b42714929b80262979e026813cfdad1f49de23fa789acb3aef8a2e315
+cryptoportfolio::bot_version: v0.2
+cryptoportfolio::bot_sha256: b2eb00cc520e2c25b7cfa7fb8e5f8cdb25fbb98da8f4a2ff75ad2eb76bc78e9d
index 9ed3375aad8408a1314ed32c12b9484044fc5fa0..32b4391d482ab3f81e48ed6b371a54d851306bb2 100644 (file)
@@ -18,7 +18,9 @@ class role::cryptoportfolio {
   $cf_pg_db = "cryptoportfolio"
   $cf_pg_password = generate_password(24, $password_seed, "postgres_cryptoportfolio")
   $cf_pg_replication_password = generate_password(24, $password_seed, "postgres_cryptoportfolio_replication")
-  $cf_pg_host = "localhost:5432"
+  $cf_pg_hostname = "localhost"
+  $cf_pg_port = "5432"
+  $cf_pg_host = "${cf_pg_hostname}:${cf_pg_port}"
 
   $cf_user = "cryptoportfolio"
   $cf_group = "cryptoportfolio"
@@ -36,6 +38,8 @@ class role::cryptoportfolio {
   $cf_front_app_static_conf = "${cf_front_app}/cmd/web/env/prod.env"
 
   $cf_bot_app = "${cf_home}/bot"
+  $cf_bot_app_conf = "${cf_home}/bot_config.ini"
+  $cf_bot_app_reports = "${cf_home}/bot_reports"
 
   file { "/var/lib/postgres/data/certs":
     ensure  => directory,
@@ -213,6 +217,13 @@ class role::cryptoportfolio {
       require     => User[$cf_user],
       refreshonly => true,
     }
+
+    file { $cf_bot_app_conf:
+      owner   => $cf_user,
+      group   => $cf_group,
+      mode    => "0600",
+      content => template("role/cryptoportfolio/bot_config.ini.erb")
+    }
   }
 
   unless empty($front_version) {
diff --git a/modules/role/templates/cryptoportfolio/bot_config.ini.erb b/modules/role/templates/cryptoportfolio/bot_config.ini.erb
new file mode 100644 (file)
index 0000000..30298eb
--- /dev/null
@@ -0,0 +1,9 @@
+[postgresql]
+host = <%= @cf_pg_hostname %>
+port = <%= @cf_pg_port %>
+user = <%= @cf_pg_user %>
+password = <%= @cf_pg_password %>
+database = <%= @cf_pg_db %>
+
+[app]
+report_path = <%= @cf_bot_app_reports %>