-
-
Notifications
You must be signed in to change notification settings - Fork 100
/
main.yml
153 lines (125 loc) · 7.11 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
##########################################################################
# Title: Sandbox: Watchtower Role | Default Variables #
# Author(s): l3uddz, salty, owine #
# URL: https://github.com/saltyorg/Sandbox #
# -- #
##########################################################################
# GNU General Public License v3.0 #
##########################################################################
---
################################
# Basics
################################
watchtower_instances: ["watchtower"]
################################
# Settings
################################
watchtower_metrics_enable: false
watchtower_metrics_external: false
watchtower_poll_interval: "43200"
################################
# Paths
################################
watchtower_paths_folder: "{{ watchtower_name }}"
watchtower_paths_location: "{{ server_appdata_path }}/{{ watchtower_paths_folder }}"
watchtower_paths_folders_list:
- "{{ watchtower_paths_location }}"
################################
# Web
################################
watchtower_web_subdomain: "{{ watchtower_name }}"
watchtower_web_domain: "{{ user.domain }}"
watchtower_web_port: "8080"
watchtower_host: "{{ lookup('vars', watchtower_name + '_web_subdomain', default=watchtower_web_subdomain)
+ '.' + lookup('vars', watchtower_name + '_web_domain', default=watchtower_web_domain) }}"
################################
# DNS
################################
watchtower_dns_record: "{{ lookup('vars', watchtower_name + '_web_subdomain', default=watchtower_web_subdomain) }}"
watchtower_dns_zone: "{{ lookup('vars', watchtower_name + '_web_domain', default=watchtower_web_domain) }}"
watchtower_dns_proxy: "{{ dns.proxied }}"
################################
# Traefik
################################
watchtower_traefik_sso_middleware: ""
watchtower_traefik_middleware_default: "{{ traefik_default_middleware }}"
watchtower_traefik_middleware_custom: ""
watchtower_traefik_certresolver: "{{ traefik_default_certresolver }}"
watchtower_traefik_enabled: "{{ true if (watchtower_metrics_enable and watchtower_metrics_externa) else false }}"
watchtower_traefik_api_enabled: false
watchtower_traefik_api_endpoint: ""
################################
# Docker
################################
# Container
watchtower_docker_container: "{{ watchtower_name }}"
# Image
watchtower_docker_image_pull: true
watchtower_docker_image_repo: "containrrr/watchtower"
watchtower_docker_image_tag: "latest"
watchtower_docker_image: "{{ lookup('vars', watchtower_name + '_docker_image_repo', default=watchtower_docker_image_repo)
+ ':' + lookup('vars', watchtower_name + '_docker_image_tag', default=watchtower_docker_image_tag) }}"
# Envs
watchtower_docker_envs_default:
TZ: "{{ tz }}"
WATCHTOWER_CLEANUP: "true"
WATCHTOWER_POLL_INTERVAL: "{{ watchtower_poll_interval }}"
WATCHTOWER_HTTP_API_METRICS: "{{ 'true' if watchtower_metrics_enable else omit }}"
watchtower_docker_envs_custom: {}
watchtower_docker_envs: "{{ lookup('vars', watchtower_name + '_docker_envs_default', default=watchtower_docker_envs_default)
| combine(lookup('vars', watchtower_name + '_docker_envs_custom', default=watchtower_docker_envs_custom)) }}"
watchtower_docker_env_file: "{{ watchtower_paths_location + '/watchtower.env' if watchtower_env.stat.exists else omit }}"
# Commands
watchtower_docker_commands_default: []
watchtower_docker_commands_custom: []
watchtower_docker_commands: "{{ lookup('vars', watchtower_name + '_docker_commands_default', default=watchtower_docker_commands_default)
+ lookup('vars', watchtower_name + '_docker_commands_custom', default=watchtower_docker_commands_custom) }}"
# Volumes
watchtower_docker_volumes_default:
- "/var/run/docker.sock:/var/run/docker.sock"
watchtower_docker_volumes_custom: []
watchtower_docker_volumes: "{{ lookup('vars', watchtower_name + '_docker_volumes_default', default=watchtower_docker_volumes_default)
+ lookup('vars', watchtower_name + '_docker_volumes_custom', default=watchtower_docker_volumes_custom) }}"
# Devices
watchtower_docker_devices_default: []
watchtower_docker_devices_custom: []
watchtower_docker_devices: "{{ lookup('vars', watchtower_name + '_docker_devices_default', default=watchtower_docker_devices_default)
+ lookup('vars', watchtower_name + '_docker_devices_custom', default=watchtower_docker_devices_custom) }}"
# Hosts
watchtower_docker_hosts_default: {}
watchtower_docker_hosts_custom: {}
watchtower_docker_hosts: "{{ docker_hosts_common
| combine(lookup('vars', watchtower_name + '_docker_hosts_default', default=watchtower_docker_hosts_default))
| combine(lookup('vars', watchtower_name + '_docker_hosts_custom', default=watchtower_docker_hosts_custom)) }}"
# Labels
watchtower_docker_labels_default: {}
watchtower_docker_labels_custom: {}
watchtower_docker_labels: "{{ docker_labels_common
| combine(lookup('vars', watchtower_name + '_docker_labels_default', default=watchtower_docker_labels_default))
| combine(lookup('vars', watchtower_name + '_docker_labels_custom', default=watchtower_docker_labels_custom)) }}"
# Hostname
watchtower_docker_hostname: "{{ watchtower_name }}"
# Network Mode
watchtower_docker_network_mode_default: "{{ docker_networks_name_common }}"
watchtower_docker_network_mode: "{{ lookup('vars', watchtower_name + '_docker_network_mode_default', default=watchtower_docker_network_mode_default) }}"
# Networks
watchtower_docker_networks_alias: "{{ watchtower_name }}"
watchtower_docker_networks_default: []
watchtower_docker_networks_custom: []
watchtower_docker_networks: "{{ docker_networks_common
+ lookup('vars', watchtower_name + '_docker_networks_default', default=watchtower_docker_networks_default)
+ lookup('vars', watchtower_name + '_docker_networks_custom', default=watchtower_docker_networks_custom) }}"
# Capabilities
watchtower_docker_capabilities_default: []
watchtower_docker_capabilities_custom: []
watchtower_docker_capabilities: "{{ lookup('vars', watchtower_name + '_docker_capabilities_default', default=watchtower_docker_capabilities_default)
+ lookup('vars', watchtower_name + '_docker_capabilities_custom', default=watchtower_docker_capabilities_custom) }}"
# Security Opts
watchtower_docker_security_opts_default: []
watchtower_docker_security_opts_custom: []
watchtower_docker_security_opts: "{{ lookup('vars', watchtower_name + '_docker_security_opts_default', default=watchtower_docker_security_opts_default)
+ lookup('vars', watchtower_name + '_docker_security_opts_custom', default=watchtower_docker_security_opts_custom) }}"
# Restart Policy
watchtower_docker_restart_policy: unless-stopped
# State
watchtower_docker_state: started