2020-11-16 15:33:26 +00:00
|
|
|
files = {
|
|
|
|
'/etc/vnstat.conf': {
|
|
|
|
'content_type': 'mako',
|
|
|
|
'context': node.metadata['vnstat'],
|
|
|
|
'triggers': {
|
|
|
|
'svc_systemd:vnstat:restart',
|
|
|
|
},
|
|
|
|
},
|
2020-11-16 16:07:05 +00:00
|
|
|
'/usr/local/bin/generate-vnstati': {
|
|
|
|
'mode': '0755',
|
|
|
|
},
|
2020-11-16 15:33:26 +00:00
|
|
|
}
|
|
|
|
|
2020-11-16 16:07:05 +00:00
|
|
|
if node.metadata['vnstat'].get('generate-web-dashboard', False):
|
|
|
|
files['/var/www/vnstat/index.html'] = {
|
|
|
|
'content_type': 'mako',
|
|
|
|
'context': node.metadata['vnstat'],
|
|
|
|
}
|
|
|
|
|
2020-11-16 15:33:26 +00:00
|
|
|
svc_systemd = {
|
|
|
|
'vnstat': {
|
|
|
|
'needs': {
|
|
|
|
'pkg_apt:vnstat',
|
|
|
|
'file:/etc/vnstat.conf',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|