ansible-nas/tasks/watchtower.yml
2018-12-29 00:22:51 +00:00

37 lines
1.5 KiB
YAML

---
- name: Watchtower Docker Container
when: watchtower_notifications_enabled == false
docker_container:
name: watchtower
image: v2tec/watchtower
pull: true
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
env:
TZ: "{{ ansible_nas_timezone }}"
command: --schedule "{{ watchtower_cron_schedule }}" --debug
restart_policy: unless-stopped
memory: 1g
- name: Watchtower Docker Container w/ Notifications
when: watchtower_notifications_enabled == true
docker_container:
name: watchtower
image: v2tec/watchtower
pull: true
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
env:
TZ: "{{ ansible_nas_timezone }}"
WATCHTOWER_NOTIFICATIONS: "{{ watchtower_notifications_type }}"
WATCHTOWER_NOTIFICATIONS_LEVEL: "{{ watchtower_notifications_level }}"
WATCHTOWER_NOTIFICATION_EMAIL_FROM: "{{ watchtower_email_from }}"
WATCHTOWER_NOTIFICATION_EMAIL_TO: "{{ watchtower_email_to }}"
WATCHTOWER_NOTIFICATION_EMAIL_SERVER: "{{ watchtower_email_server }}"
WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER: "{{ watchtower_email_server_user }}"
WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD: "{{ watchtower_email_server_password }}"
WATCHTOWER_NOTIFICATION_SLACK_HOOK_URL: "{{ watchtower_slack_hook_url }}"
WATCHTOWER_NOTIFICATION_SLACK_IDENTIFIER: "{{ watchtower_slack_identifier }}"
command: --schedule "{{ watchtower_cron_schedule }}" --debug
restart_policy: unless-stopped
memory: 1g