]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/role/manifests/cryptoportfolio/front.pp
Add logger for cryptoportfolio
[perso/Immae/Projets/Puppet.git] / modules / role / manifests / cryptoportfolio / front.pp
index e676395607f5f80ce4d8274a9f422f3388858c1d..a6b25c4dc484a641c5717c2d90fe9d5095bece78 100644 (file)
@@ -143,6 +143,31 @@ class role::cryptoportfolio::front inherits role::cryptoportfolio {
     refreshonly => true,
   }
 
+  # Slack logger
+  $slack_logger = lookup("role::cryptoportfolio::front::slack_logger")
+  unless empty($slack_logger) {
+    file { "/usr/local/bin/api_logger":
+      mode    => "0755",
+      content => template("role/cryptoportfolio/api_logger.py.erb"),
+    }
+    ->
+    file { "/etc/systemd/system/cryptoportfolio-log.service":
+      mode    => "0644",
+      owner   => "root",
+      group   => "root",
+      content => template("role/cryptoportfolio/cryptoportfolio-log.service.erb"),
+      notify  => Exec["systemctl daemon-reload"],
+    }
+    ->
+    service { 'cryptoportfolio-log':
+      enable    => true,
+      ensure    => "running",
+      require   => [
+        Service["cryptoportfolio-app"],
+      ],
+    }
+  }
+
   unless empty($webhook_url) {
     exec { "front-slack-notify":
       refreshonly => true,