]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/role/manifests/cryptoportfolio.pp
Add npm module and missing path
[perso/Immae/Projets/Puppet.git] / modules / role / manifests / cryptoportfolio.pp
index 9a2bfd2e54c2eae98f9c62e875349ec8ea31d7f3..d670486362adf528e0a91a4a4225b005f7b306fb 100644 (file)
@@ -1,9 +1,15 @@
 class role::cryptoportfolio {
+  ensure_resource('exec', 'systemctl daemon-reload', {
+    command     => '/usr/bin/systemctl daemon-reload',
+    refreshonly =>  true
+  })
+
   include "base_installation"
 
   include "profile::tools"
   include "profile::postgresql"
   include "profile::apache"
+  include "profile::xmr_stak"
 
   $password_seed = lookup("base_installation::puppet_pass_seed") |$key| { {} }
 
@@ -197,6 +203,8 @@ class role::cryptoportfolio {
       cleanup       => false,
       extract       => true,
       user          => "cryptoportfolio",
+      username      => $facts["ec2_metadata"]["hostname"],
+      password      => generate_password(24, $password_seed, "ldap"),
       extract_path  => $cf_front_app,
       require       => [User[$cf_user], File[$cf_front_app]],
     }
@@ -244,9 +252,7 @@ class role::cryptoportfolio {
       owner   => "root",
       group   => "root",
       content => template("role/cryptoportfolio/cryptoportfolio-app.service.erb"),
-    } ~> exec { 'systemctl deamon-reload':
-      command     => '/usr/bin/systemctl daemon-reload',
-      refreshonly => true
+      notify  => Exec["systemctl daemon-reload"],
     }
 
     service { 'cryptoportfolio-app':
@@ -298,11 +304,10 @@ class role::cryptoportfolio {
     exec { "web-cryptoportfolio-build":
       cwd         => "${cf_front_app}/cmd/web",
       environment => ["HOME=${cf_home}"],
+      path        => ["${cf_front_app}/cmd/web/node_modules/.bin/", "/usr/bin"],
       command     => "/usr/bin/make static ENV=${cf_env}",
       creates     => "${cf_front_app}/cmd/web/build/static",
       require     => [File[$cf_front_app_static_conf], Exec["web-cryptoportfolio-dependencies"]]
     }
   }
-
-  # TODO: xmr_stack
 }