diff --git a/coreos-config/roles/compose_project/templates/watchtower/docker-compose.yaml b/coreos-config/roles/compose_project/templates/watchtower/docker-compose.yaml index 1a330c9..5e4635b 100644 --- a/coreos-config/roles/compose_project/templates/watchtower/docker-compose.yaml +++ b/coreos-config/roles/compose_project/templates/watchtower/docker-compose.yaml @@ -10,6 +10,35 @@ services: WATCHTOWER_CLEANUP: 1 WATCHTOWER_ROLLING_RESTART: 1 WATCHTOWER_NOTIFICATION_URL: "matrix://{{ watchtower.matrix.user }}:{{ watchtower.matrix.password }}@pantalaimon:8008/?disableTLS=yes{% if watchtower.matrix.options is defined %}&{{ watchtower.matrix.options | join('&') }}{% endif%}" + WATCHTOWER_NOTIFICATION_REPORT: "true" + WATCHTOWER_NOTIFICATION_TEMPLATE: | + {% raw %} + {{- if .Report -}} + {{- with .Report -}} + {{- if ( or .Updated .Failed ) -}} + {% endraw %} + Updates on {{ inventory_hostname }}{% raw %} + {{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}} + - {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}} + {{- end -}} + {{- range .Failed}} + - {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- else -}} + {% endraw %} + Updates on {{ inventory_hostname }}{% raw %} + {{range .Entries -}}{{.Message}}{{"\n"}}{{- end -}} + {{- end -}}{% endraw %} + volumes: - /var/run/docker.sock:/var/run/docker.sock - /home/core/.docker:/config