bundlewrap/bundles/nginx/metadata.py

43 lines
900 B
Python

defaults = {
'apt': {
'repos': {
'nginx': {
'items': [
'deb http://nginx.org/packages/debian buster nginx',
],
},
},
'unattended-upgrades': {
'origins': {
'o=nginx,a=stable,n=buster,l=nginx,c=nginx',
},
},
'packages': {
'nginx': {},
},
},
'nginx': {
'worker_processes': 4,
'worker_connections': 1000,
},
}
@metadata_reactor
def letsencrypt(metadata):
if not node.has_bundle('letsencrypt'):
raise DoNotRunAgain
domains = {}
for domain in metadata.get('nginx/vhosts', {}).keys():
domains[domain] = set()
return {
'letsencrypt': {
'domains': domains,
'reload_after': {
'nginx',
},
},
}