have more bundles provide nginx metadata for themselves

This commit is contained in:
Franzi 2021-07-16 14:20:01 +02:00
parent 2ca14d0f62
commit 6022bac0ef
Signed by: kunsi
GPG key ID: 12E3D2136B818350
6 changed files with 63 additions and 29 deletions

View file

@ -23,3 +23,34 @@ defaults = {
},
},
}
@metadata_reactor.provides(
'nginx/vhosts/travelynx',
)
def nginx(metadata):
if not node.has_bundle('nginx'):
raise DoNotRunAgain
return {
'nginx': {
'vhosts': {
'travelynx': {
'domain': metadata.get('travelynx/domain'),
'locations': {
'/': {
'target': 'http://127.0.0.1:22020',
},
'/static': {
'root': '/opt/travelynx/public',
},
'/service-worker.js': {
'root': '/opt/travelynx/public',
},
},
'website_check_path': '/login',
'website_check_string': 'travelynx',
},
},
},
}