This repository has been archived on 2024-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
cpx-ansible/roles/docker_services/tasks/services/watchtower.yml
2023-04-21 00:28:07 +02:00

21 lines
618 B
YAML

# vim: ft=yaml.ansible
---
- name: Create Docker network for Watchtower
community.docker.docker_network:
name: watchtower
state: present
- name: Deploy Watchtower Docker container
community.docker.docker_container:
name: watchtower
state: "{{ 'absent' if stop is defined and stop else 'started' }}"
restart: "{{ stop is undefined or not stop }}"
image: containrrr/watchtower:{{ services.watchtower.version }}
restart_policy: always
networks:
- name: watchtower
env:
WATCHTOWER_POLL_INTERVAL: '3600'
volumes:
- /var/run/docker.sock:/var/run/docker.sock:rw