bundles/nginx: use DEFAULTS for letsencrypt

This commit is contained in:
Franzi 2020-07-19 10:58:54 +02:00
parent ce0af62968
commit 31a1a88d13
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -31,13 +31,16 @@ def letsencrypt(metadata):
if not node.has_bundle('letsencrypt'): if not node.has_bundle('letsencrypt'):
return metadata, DONE return metadata, DONE
le = metadata.setdefault('letsencrypt', {}) domains = {}
domains = le.setdefault('domains', {})
for domain in metadata.get('nginx', {}).get('vhosts', {}).keys(): for domain in metadata.get('nginx', {}).get('vhosts', {}).keys():
domains[domain] = set() domains[domain] = set()
reload = le.setdefault('reload_after', set()) return {
reload.add('nginx') 'letsencrypt': {
'domains': domains,
return metadata, RUN_ME_AGAIN 'reload_after': {
'nginx',
},
},
}, DEFAULTS, RUN_ME_AGAIN