bundlewrap/bundles/vnstat/items.py
Franziska Kunsmann 26c2be07cf
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/vnstat: adjust vnstati calls for debian bullseye
2021-04-11 09:01:58 +02:00

37 lines
1,014 B
Python

files = {
'/etc/systemd/system/vnstati.service': {},
'/etc/systemd/system/vnstati.timer': {},
'/etc/vnstat.conf': {
'content_type': 'mako',
'context': node.metadata['vnstat'],
'triggers': {
'svc_systemd:vnstat:restart',
},
},
'/usr/local/bin/generate-vnstati': {
'mode': '0755',
},
}
if node.metadata.get('vnstat/generate-web-dashboard', False):
files['/var/www/vnstat/index.html'] = {
'content_type': 'mako',
'context': node.metadata['vnstat'],
}
svc_systemd = {
'vnstat': {
'needs': {
'pkg_apt:vnstat',
'file:/etc/vnstat.conf',
},
},
'vnstati.timer': {
'needs': {
'file:/etc/systemd/system/vnstati.service',
'file:/etc/systemd/system/vnstati.timer',
},
'running': node.metadata.get('vnstat/generate-web-dashboard', False),
'enabled': node.metadata.get('vnstat/generate-web-dashboard', False),
},
}