aboutsummaryrefslogtreecommitdiff
path: root/modules/role
diff options
context:
space:
mode:
Diffstat (limited to 'modules/role')
-rw-r--r--modules/role/manifests/cryptoportfolio.pp13
-rw-r--r--modules/role/templates/cryptoportfolio/bot_config.ini.erb9
2 files changed, 21 insertions, 1 deletions
diff --git a/modules/role/manifests/cryptoportfolio.pp b/modules/role/manifests/cryptoportfolio.pp
index 9ed3375..32b4391 100644
--- a/modules/role/manifests/cryptoportfolio.pp
+++ b/modules/role/manifests/cryptoportfolio.pp
@@ -18,7 +18,9 @@ class role::cryptoportfolio {
18 $cf_pg_db = "cryptoportfolio" 18 $cf_pg_db = "cryptoportfolio"
19 $cf_pg_password = generate_password(24, $password_seed, "postgres_cryptoportfolio") 19 $cf_pg_password = generate_password(24, $password_seed, "postgres_cryptoportfolio")
20 $cf_pg_replication_password = generate_password(24, $password_seed, "postgres_cryptoportfolio_replication") 20 $cf_pg_replication_password = generate_password(24, $password_seed, "postgres_cryptoportfolio_replication")
21 $cf_pg_host = "localhost:5432" 21 $cf_pg_hostname = "localhost"
22 $cf_pg_port = "5432"
23 $cf_pg_host = "${cf_pg_hostname}:${cf_pg_port}"
22 24
23 $cf_user = "cryptoportfolio" 25 $cf_user = "cryptoportfolio"
24 $cf_group = "cryptoportfolio" 26 $cf_group = "cryptoportfolio"
@@ -36,6 +38,8 @@ class role::cryptoportfolio {
36 $cf_front_app_static_conf = "${cf_front_app}/cmd/web/env/prod.env" 38 $cf_front_app_static_conf = "${cf_front_app}/cmd/web/env/prod.env"
37 39
38 $cf_bot_app = "${cf_home}/bot" 40 $cf_bot_app = "${cf_home}/bot"
41 $cf_bot_app_conf = "${cf_home}/bot_config.ini"
42 $cf_bot_app_reports = "${cf_home}/bot_reports"
39 43
40 file { "/var/lib/postgres/data/certs": 44 file { "/var/lib/postgres/data/certs":
41 ensure => directory, 45 ensure => directory,
@@ -213,6 +217,13 @@ class role::cryptoportfolio {
213 require => User[$cf_user], 217 require => User[$cf_user],
214 refreshonly => true, 218 refreshonly => true,
215 } 219 }
220
221 file { $cf_bot_app_conf:
222 owner => $cf_user,
223 group => $cf_group,
224 mode => "0600",
225 content => template("role/cryptoportfolio/bot_config.ini.erb")
226 }
216 } 227 }
217 228
218 unless empty($front_version) { 229 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
index 0000000..30298eb
--- /dev/null
+++ b/modules/role/templates/cryptoportfolio/bot_config.ini.erb
@@ -0,0 +1,9 @@
1[postgresql]
2host = <%= @cf_pg_hostname %>
3port = <%= @cf_pg_port %>
4user = <%= @cf_pg_user %>
5password = <%= @cf_pg_password %>
6database = <%= @cf_pg_db %>
7
8[app]
9report_path = <%= @cf_bot_app_reports %>