This repository has been archived on 2023-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
pi-ansible/roles/docker_services/tasks/services/watchtower.yml

22 lines
674 B
YAML
Raw Normal View History

2022-12-22 19:18:27 +00:00
# vim: ft=yaml.ansible
2022-12-22 16:58:48 +00:00
---
- name: Create Docker network for Watchtower
2023-03-22 18:31:21 +00:00
community.docker.docker_network:
name: watchtower
state: present
2022-12-22 16:58:48 +00:00
- name: Deploy Watchtower Docker container
2023-03-22 18:31:21 +00:00
community.docker.docker_container:
2022-12-22 16:58:48 +00:00
name: watchtower
2023-08-05 12:36:12 +00:00
state: "{{ 'absent' if down is defined and down else 'started' }}"
restart: "{{ restart is defined and restart }}"
recreate: "{{ recreate is defined and recreate }}"
2023-01-03 21:30:22 +00:00
image: containrrr/watchtower:{{ services.watchtower.version }}
2023-01-14 18:25:13 +00:00
restart_policy: always
networks:
- name: watchtower
2022-12-22 16:58:48 +00:00
env:
2022-12-23 15:57:37 +00:00
WATCHTOWER_POLL_INTERVAL: '3600'
2022-12-22 16:58:48 +00:00
volumes:
- /var/run/docker.sock:/var/run/docker.sock:rw