Skip to content
Snippets Groups Projects
Commit f6ef3b18 authored by Christian Elberfeld's avatar Christian Elberfeld
Browse files

install watchtower on webserver and verwaltung

parent 17b3b06d
No related branches found
No related tags found
No related merge requests found
---
- include_tasks: ../functions/get_secret.yml
with_items:
- { path: "{{ basedir }}/matrix_notification_access_token", length: -1 }
- name: "create folder struct for {{ servicename }}"
file:
path: "{{ item }}"
state: "directory"
with_items:
- "{{ basedir }}"
- name: Konfig-Dateien erstellen (base,graphite)
template:
src: "{{ item }}"
dest: "{{ basedir }}/{{ item }}"
with_items:
- docker-compose.yml
register: dockerconfig
- name: "start {{ servicename }} docker"
docker_compose:
project_src: "{{ basedir }}"
state: present
build: "{{ dockerconfig.changed }}"
version: "2.4"
services:
app:
image: containrrr/watchtower:latest
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
TZ: "Europe/Berlin"
#WATCHTOWER_RUN_ONCE: "true"
WATCHTOWER_MONITOR_ONLY: "true"
WATCHTOWER_NOTIFICATION_REPORT: "true"
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 -}}
{{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 -}}
{{- else -}}
{{range .Entries -}}{{.Message}}{{"\n"}}{{- end -}}
{{- end -}}
{% endraw %}
...@@ -88,6 +88,7 @@ matrix: ...@@ -88,6 +88,7 @@ matrix:
domain: matrix.warpzone.ms domain: matrix.warpzone.ms
public_url: https://matrix.warpzone.ms public_url: https://matrix.warpzone.ms
identity_server: https://matrix.warpzone.ms identity_server: https://matrix.warpzone.ms
notifications_room_id: "!iYefxbySFEfFQfUGEK:matrix.warpzone.ms"
# Monitoring # Monitoring
monitoring: monitoring:
......
...@@ -78,6 +78,7 @@ alert: ...@@ -78,6 +78,7 @@ alert:
- { name: "nextcloud_redis_1" } - { name: "nextcloud_redis_1" }
- { name: "nextcloud_webcron_1" } - { name: "nextcloud_webcron_1" }
- { name: "traefik_app_1" } - { name: "traefik_app_1" }
- { name: "watchtower_app_1" }
disks: disks:
- { mountpoint: "/", warn: "5 GB", crit: "1 GB" } - { mountpoint: "/", warn: "5 GB", crit: "1 GB" }
- { mountpoint: "/srv", warn: "5 GB", crit: "1 GB" } - { mountpoint: "/srv", warn: "5 GB", crit: "1 GB" }
......
...@@ -112,6 +112,7 @@ alert: ...@@ -112,6 +112,7 @@ alert:
- { name: "traefik_app_1" } - { name: "traefik_app_1" }
- { name: "vpnserver_app_1" } - { name: "vpnserver_app_1" }
- { name: "warpapi_app_1" } - { name: "warpapi_app_1" }
- { name: "watchtower_app_1" }
- { name: "wordpress_app_1" } - { name: "wordpress_app_1" }
- { name: "wordpress_db_1" } - { name: "wordpress_db_1" }
- { name: "workadventure_back_1" } - { name: "workadventure_back_1" }
......
...@@ -161,6 +161,11 @@ ...@@ -161,6 +161,11 @@
domain_default: "www.warpzone.ms", domain_default: "www.warpzone.ms",
matrix_federation: true matrix_federation: true
} }
- {
role: common/docker_watchtower, tags: watchtower,
servicename: watchtower,
basedir: /srv/watchtower,
}
- { - {
role: webserver/docker_coturn, tags: coturn, role: webserver/docker_coturn, tags: coturn,
servicename: "coturn", servicename: "coturn",
...@@ -265,6 +270,11 @@ ...@@ -265,6 +270,11 @@
basedir: /srv/traefik, basedir: /srv/traefik,
domain: "warpzone.ms", domain: "warpzone.ms",
} }
- {
role: common/docker_watchtower, tags: watchtower,
servicename: watchtower,
basedir: /srv/watchtower,
}
- { - {
role: verwaltung/docker_gitea, tags: gitea, role: verwaltung/docker_gitea, tags: gitea,
servicename: "gitea", servicename: "gitea",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment