-
Notifications
You must be signed in to change notification settings - Fork 0
/
metadata.py
50 lines (45 loc) · 1.35 KB
/
metadata.py
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
defaults = {
'lego': {
'version': '4.17.4',
'arch': 'linux_amd64',
'checksum': 'f362d59ff5b6f92c599e3151dcf7b6ed853de05533be179b306ca40a7b67fb47',
'default_challenge': 'http',
'path': '/etc/lego',
'challenges': {
'http': {
'type': 'http',
'provider': '--http.webroot /var/www/letsencrypt',
'environment': {
},
'additional_params': '',
}
},
'renew_hooks': [],
#'run_hooks': [],
'renewal_time': 'Mon..Fri *-*-* 03:30:00 UTC', # See https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html
'randomized_delay': '1h',
},
}
@metadata_reactor
def backward_compatibility(metadata):
return {
'lego': {
'renew_hooks': [metadata.get('lego/renew_hook', '')],
}
}
@metadata_reactor
def add_nginx_domains(metadata):
if not node.has_bundle('nginx'):
raise DoNotRunAgain
domains = {}
for domain, config in metadata.get('nginx/sites', {}).items():
if not config.get('ssl', {}).get('letsencrypt', False):
continue
domains[domain] = {
'additional_domains': config.get('additional_server_names', []),
}
return {
'lego': {
'domains': domains
}
}