forked from infra/ansible
hedgedoc: enable automatic updates of docker images
This commit is contained in:
parent
44f9505bef
commit
d7c0716f4a
@ -6,6 +6,9 @@
|
||||
- name: Restart hedgedoc
|
||||
service: name=hedgedoc state=restarted
|
||||
|
||||
- name: Restart hedgedoc-reload
|
||||
service: name=hedgedoc-reload state=restarted
|
||||
|
||||
- name: Restart nginx
|
||||
service: name=nginx state=restarted
|
||||
|
||||
|
@ -42,9 +42,21 @@
|
||||
- Reload systemd
|
||||
- Restart hedgedoc
|
||||
|
||||
- name: Systemd unit for hedgedoc-reload
|
||||
template: src=hedgedoc-reload.{{ item }}.j2 dest=/etc/systemd/system/hedgedoc-reload.{{ item }}
|
||||
with_items:
|
||||
- "service"
|
||||
- "timer"
|
||||
notify:
|
||||
- Reload systemd
|
||||
- Restart hedgedoc-reload
|
||||
|
||||
- name: Start the hedgedoc service
|
||||
service: name=hedgedoc state=started enabled=yes
|
||||
|
||||
- name: Enable auto update timer
|
||||
service: name=hedgedoc-reload.timer state=started enabled=yes
|
||||
|
||||
- name: Enable monitoring
|
||||
include_role: name=icinga-monitor tasks_from=http
|
||||
vars:
|
||||
|
@ -1,4 +1,5 @@
|
||||
version: "3"
|
||||
---
|
||||
version: "3.4"
|
||||
services:
|
||||
database:
|
||||
image: postgres:13-alpine
|
||||
|
7
roles/hedgedoc/templates/hedgedoc-reload.service.j2
Normal file
7
roles/hedgedoc/templates/hedgedoc-reload.service.j2
Normal file
@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=Refresh hedgedoc images
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
||||
ExecStart=/bin/systemctl reload-or-restart hedgedoc.service
|
10
roles/hedgedoc/templates/hedgedoc-reload.timer.j2
Normal file
10
roles/hedgedoc/templates/hedgedoc-reload.timer.j2
Normal file
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Refresh authentik images
|
||||
Requires=authentik.service
|
||||
After=authentik.service
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*:0/15
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
@ -17,6 +17,8 @@ WorkingDirectory=/opt/hedgedoc
|
||||
|
||||
# Make sure no old containers are running
|
||||
ExecStartPre=/usr/bin/docker-compose down -v
|
||||
# Update images
|
||||
ExecStartPre=-/usr/bin/docker-compose pull --quiet
|
||||
|
||||
# Compose up
|
||||
ExecStart=/usr/bin/docker-compose up
|
||||
@ -24,5 +26,9 @@ ExecStart=/usr/bin/docker-compose up
|
||||
# Compose down, remove containers and volumes
|
||||
ExecStop=/usr/bin/docker-compose down -v
|
||||
|
||||
# Refresh on reload
|
||||
ExecReload=-/usr/bin/docker-compose pull --quiet
|
||||
ExecReload=/usr/bin/docker-compose up -d
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
Loading…
Reference in New Issue
Block a user