diff options
-rw-r--r-- | environments/production/data/nodes/vps494082.yaml | 4 | ||||
-rw-r--r-- | modules/profile/manifests/tools.pp | 2 | ||||
-rw-r--r-- | modules/role/manifests/cryptoportfolio.pp | 13 | ||||
-rw-r--r-- | modules/role/templates/cryptoportfolio/bot_config.ini.erb | 9 |
4 files changed, 24 insertions, 4 deletions
diff --git a/environments/production/data/nodes/vps494082.yaml b/environments/production/data/nodes/vps494082.yaml index 59b2447..8cba9a2 100644 --- a/environments/production/data/nodes/vps494082.yaml +++ b/environments/production/data/nodes/vps494082.yaml | |||
@@ -1,5 +1,5 @@ | |||
1 | base_installation::system_hostname: cryptoportfolio.immae.eu | 1 | base_installation::system_hostname: cryptoportfolio.immae.eu |
2 | cryptoportfolio::front_version: v0.0.1-2-g989fb5c | 2 | cryptoportfolio::front_version: v0.0.1-2-g989fb5c |
3 | cryptoportfolio::front_sha256: 1e82044b6a40b415913658bb1b896087d8c2c43d64c5862cd84f60804f5854dc | 3 | cryptoportfolio::front_sha256: 1e82044b6a40b415913658bb1b896087d8c2c43d64c5862cd84f60804f5854dc |
4 | cryptoportfolio::bot_version: v0.1 | 4 | cryptoportfolio::bot_version: v0.2 |
5 | cryptoportfolio::bot_sha256: bb974d6b42714929b80262979e026813cfdad1f49de23fa789acb3aef8a2e315 | 5 | cryptoportfolio::bot_sha256: b2eb00cc520e2c25b7cfa7fb8e5f8cdb25fbb98da8f4a2ff75ad2eb76bc78e9d |
diff --git a/modules/profile/manifests/tools.pp b/modules/profile/manifests/tools.pp index 5cb8038..5243cac 100644 --- a/modules/profile/manifests/tools.pp +++ b/modules/profile/manifests/tools.pp | |||
@@ -1,3 +1,3 @@ | |||
1 | class profile::tools { | 1 | class profile::tools { |
2 | ensure_packages(['vim', 'bash-completion', 'net-tools', 'htop', 'ipython']) | 2 | ensure_packages(['vim', 'bash-completion', 'net-tools', 'htop', 'ipython', 'jq']) |
3 | } | 3 | } |
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] | ||
2 | host = <%= @cf_pg_hostname %> | ||
3 | port = <%= @cf_pg_port %> | ||
4 | user = <%= @cf_pg_user %> | ||
5 | password = <%= @cf_pg_password %> | ||
6 | database = <%= @cf_pg_db %> | ||
7 | |||
8 | [app] | ||
9 | report_path = <%= @cf_bot_app_reports %> | ||