]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/role/manifests/cryptoportfolio.pp
Add xmr-stak
[perso/Immae/Projets/Puppet.git] / modules / role / manifests / cryptoportfolio.pp
index a1cfde328a7abd76cc133475ac47ed4ab335afcb..5860f90a8163b1c796df9cbbc5474e951bb60a26 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| { {} }
 
@@ -206,7 +212,7 @@ class role::cryptoportfolio {
       target  => $cf_front_app,
       before => File[$cf_front_app],
     } ~>
-    exec { "remove old directory":
+    exec { "remove old ${cf_front_app} directory":
       refreshonly => true,
       user        => $cf_user,
       command     => "/usr/bin/rm -rf ${cf_front_app}",
@@ -244,9 +250,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':
@@ -257,6 +261,12 @@ class role::cryptoportfolio {
         File["/etc/systemd/system/cryptoportfolio-app.service"],
         Postgresql::Server::Db[$cf_pg_db]
       ],
+    } ~>
+    exec { "dump $cf_pg_db structure":
+      refreshonly => true,
+      user        => $::profile::postgresql::pg_user,
+      group       => $::profile::postgresql::pg_user,
+      command     => "/usr/bin/pg_dump --schema-only --clean --no-publications $cf_pg_db > /var/lib/postgres/${cf_pg_db}.schema",
     }
 
     file { $cf_front_app_api_conf:
@@ -297,6 +307,4 @@ class role::cryptoportfolio {
       require     => [File[$cf_front_app_static_conf], Exec["web-cryptoportfolio-dependencies"]]
     }
   }
-
-  # TODO: xmr_stack
 }