add watchtower container. elke dag om 5 uur worden de containers ge-update door watchtower indien nodig.
This commit is contained in:
parent
68981f3f66
commit
5afc14edf4
5 changed files with 28 additions and 0 deletions
|
@ -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'}
|
||||
|
|
7
roles/watchtower/files/docker-compose.yml
Normal file
7
roles/watchtower/files/docker-compose.yml
Normal 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
|
4
roles/watchtower/meta/main.yml
Normal file
4
roles/watchtower/meta/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
dependencies:
|
||||
- role: common
|
||||
- role: docker
|
||||
|
14
roles/watchtower/tasks/main.yml
Normal file
14
roles/watchtower/tasks/main.yml
Normal 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
|
||||
|
2
roles/watchtower/vars/main.yml
Normal file
2
roles/watchtower/vars/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
service_name: watchtower
|
||||
service_dir: "{{ base_service_dir }}/{{ service_name }}"
|
Reference in a new issue