2021-10-31 08:43:53 +00:00
|
|
|
extra_java_opts = []
|
|
|
|
|
|
|
|
for opt, value in sorted(node.metadata.get('openhab/java_opts', {}).items()):
|
|
|
|
if value is None:
|
|
|
|
extra_java_opts.append(f'-D{opt}')
|
|
|
|
else:
|
|
|
|
extra_java_opts.append(f'-D{opt}={value}')
|
|
|
|
|
|
|
|
files = {
|
|
|
|
'/etc/default/openhab': {
|
|
|
|
'content_type': 'mako',
|
|
|
|
'context': {
|
|
|
|
'extra_java_opts': ' '.join(extra_java_opts),
|
|
|
|
},
|
|
|
|
'triggers': {
|
|
|
|
'svc_systemd:openhab:restart',
|
|
|
|
},
|
|
|
|
},
|
2022-02-13 08:48:37 +00:00
|
|
|
'/etc/backup-pre-hooks.d/40-openhab': {
|
|
|
|
'source': 'backup-pre-hook',
|
|
|
|
'mode': '0755',
|
|
|
|
}
|
2021-10-31 08:43:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
svc_systemd = {
|
|
|
|
'openhab': {
|
|
|
|
'needs': {
|
|
|
|
'pkg_apt:openhab',
|
|
|
|
'pkg_apt:openhab-addons',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|