aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-05-13 15:41:16 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-05-13 15:41:16 +0200
commita859ab30660104d25485824afa1c23de454bb5ed (patch)
tree2805da543649337d495f6640d2effd1b767ac7d7
parent123ee097b8c8f69e8cade9f618585065d3fc7948 (diff)
downloadPuppet-a859ab30660104d25485824afa1c23de454bb5ed.tar.gz
Puppet-a859ab30660104d25485824afa1c23de454bb5ed.tar.zst
Puppet-a859ab30660104d25485824afa1c23de454bb5ed.zip
wait for journal rather than polling
-rw-r--r--modules/role/manifests/cryptoportfolio/front.pp6
-rw-r--r--modules/role/templates/cryptoportfolio/api_logger.py.erb2
2 files changed, 6 insertions, 2 deletions
diff --git a/modules/role/manifests/cryptoportfolio/front.pp b/modules/role/manifests/cryptoportfolio/front.pp
index 3612fd5..aa57f4e 100644
--- a/modules/role/manifests/cryptoportfolio/front.pp
+++ b/modules/role/manifests/cryptoportfolio/front.pp
@@ -151,6 +151,7 @@ class role::cryptoportfolio::front inherits role::cryptoportfolio {
151 file { "/usr/local/bin/api_logger": 151 file { "/usr/local/bin/api_logger":
152 mode => "0755", 152 mode => "0755",
153 content => template("role/cryptoportfolio/api_logger.py.erb"), 153 content => template("role/cryptoportfolio/api_logger.py.erb"),
154 notify => Service["cryptoportfolio-log"],
154 } 155 }
155 -> 156 ->
156 file { "/etc/systemd/system/cryptoportfolio-log.service": 157 file { "/etc/systemd/system/cryptoportfolio-log.service":
@@ -158,7 +159,10 @@ class role::cryptoportfolio::front inherits role::cryptoportfolio {
158 owner => "root", 159 owner => "root",
159 group => "root", 160 group => "root",
160 content => template("role/cryptoportfolio/cryptoportfolio-log.service.erb"), 161 content => template("role/cryptoportfolio/cryptoportfolio-log.service.erb"),
161 notify => Exec["systemctl daemon-reload"], 162 notify => [
163 Exec["systemctl daemon-reload"],
164 Service["cryptoportfolio-log"]
165 ]
162 } 166 }
163 -> 167 ->
164 service { 'cryptoportfolio-log': 168 service { 'cryptoportfolio-log':
diff --git a/modules/role/templates/cryptoportfolio/api_logger.py.erb b/modules/role/templates/cryptoportfolio/api_logger.py.erb
index 3fb14a0..ad296e8 100644
--- a/modules/role/templates/cryptoportfolio/api_logger.py.erb
+++ b/modules/role/templates/cryptoportfolio/api_logger.py.erb
@@ -50,4 +50,4 @@ while True:
50 lines = [entry["MESSAGE"] for entry in list(j)] 50 lines = [entry["MESSAGE"] for entry in list(j)]
51 if len(lines) > 0: 51 if len(lines) > 0:
52 send_to_discord("\n".join(lines)) 52 send_to_discord("\n".join(lines))
53 time.sleep(3) 53 j.wait()