From cff23caac6b8cbca0cc0497f3af882eb13c9a7a2 Mon Sep 17 00:00:00 2001
From: Christian Elberfeld <6413499+elberfeld@users.noreply.github.com>
Date: Wed, 17 Apr 2024 16:41:20 +0200
Subject: [PATCH] Watchtower Benachrichtigungen nur bei Updates und Fehlern

---
 .../templates/docker-compose.yml                | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/common/docker_watchtower/templates/docker-compose.yml b/common/docker_watchtower/templates/docker-compose.yml
index 74e68643..deb5d676 100644
--- a/common/docker_watchtower/templates/docker-compose.yml
+++ b/common/docker_watchtower/templates/docker-compose.yml
@@ -19,27 +19,24 @@ services:
       WATCHTOWER_NOTIFICATION_URL: >
         matrix://:{{ matrix_notification_access_token }}@{{ matrix.domain }}/?rooms={{ matrix.notifications_room_id }}
       WATCHTOWER_NOTIFICATION_TEMPLATE: |
-        Watchtower @ {{ inventory_hostname }} {% raw %} {{"\n"}}
         {{- if .Report -}}
           {{- with .Report -}}
+            {{- if ( or .Updated .Failed ) -}}
+        Watchtower @ webserver2  {{"\n"}}
         {{len .Scanned}} Scanned, {{len .Updated}} Updated, {{len .Failed}} Failed
               {{- range .Updated}}
         - {{.Name}} ({{.ImageName}}): {{.CurrentImageID.ShortID}} updated to {{.LatestImageID.ShortID}}
               {{- end -}}
-              {{- range .Fresh}}
-        - {{.Name}} ({{.ImageName}}): {{.State}}
-            {{- end -}}
-            {{- range .Skipped}}
+              {{- range .Skipped}}
         - {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}}
-            {{- end -}}
-            {{- range .Failed}}
+              {{- end -}}
+              {{- range .Failed}}
         - {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}}
+              {{- end -}}
             {{- end -}}
           {{- end -}}
-        {{- else -}}
-          {{range .Entries -}}{{.Message}}{{"\n"}}{{- end -}}
         {{- end -}}
-        {% endraw %}
+
 
 
 
-- 
GitLab