add watchtower container. elke dag om 5 uur worden de containers ge-update door watchtower indien nodig.

This commit is contained in:
pizzaniels 2023-02-05 17:08:54 +01:00
parent 68981f3f66
commit 5afc14edf4
5 changed files with 28 additions and 0 deletions

View file

@ -2,6 +2,7 @@
hosts: homeserver
roles:
- {role: 'ssh', tags: 'ssh'}
- {role: 'watchtower', tags: 'watchtower'}
- {role: 'borg', tags: 'borg'}
- {role: 'nsd', tags: 'nsd'}
- {role: 'forgejo', tags: 'forgejo'}

View file

@ -0,0 +1,7 @@
version: "3"
services:
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --schedule "0 0 4 * * *" # 4 uur UTC = 5 uur NL tijd

View file

@ -0,0 +1,4 @@
dependencies:
- role: common
- role: docker

View file

@ -0,0 +1,14 @@
- name: Create app directory
file:
path: "{{ service_dir }}"
state: directory
- name: Copy Docker Compose script
copy:
src: "{{ role_path }}/files/docker-compose.yml"
dest: "{{ service_dir }}/docker-compose.yml"
- name: Start the Docker Compose
docker_compose:
project_src: "{{ service_dir }}"
pull: true
remove_orphans: true

View file

@ -0,0 +1,2 @@
service_name: watchtower
service_dir: "{{ base_service_dir }}/{{ service_name }}"