bundlewrap/bundles/vnstat/items.py
Franzi e809ed4859
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/vnstat: changes in systemd unit files must trigger daemon-reload
2021-04-11 11:18:42 +02:00

46 lines
1.1 KiB
Python

files = {
'/etc/systemd/system/vnstati.service': {
'triggers': {
'action:systemd-reload',
},
},
'/etc/systemd/system/vnstati.timer': {
'triggers': {
'action:systemd-reload',
},
},
'/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),
},
}