From 6b95d3bd38307c1bd320a16368d0a3753601730d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 13 May 2018 14:42:51 +0200 Subject: Add logger for cryptoportfolio --- modules/role/manifests/cryptoportfolio/front.pp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'modules/role/manifests') diff --git a/modules/role/manifests/cryptoportfolio/front.pp b/modules/role/manifests/cryptoportfolio/front.pp index e676395..a6b25c4 100644 --- a/modules/role/manifests/cryptoportfolio/front.pp +++ b/modules/role/manifests/cryptoportfolio/front.pp @@ -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, -- cgit v1.2.3