bundlewrap/bundles/telegraf/items.py
2021-11-10 02:09:42 +01:00

18 lines
450 B
Python

from tomlkit import dumps
import json
from bundlewrap.metadata import MetadataJSONEncoder
files['/etc/telegraf/telegraf.conf'] = {
'content': dumps(json.loads(json.dumps(node.metadata.get('telegraf/config'), cls=MetadataJSONEncoder)), sort_keys=True),
'triggers': [
'svc_systemd:telegraf:restart',
],
}
svc_systemd['telegraf'] = {
'needs': [
'file:/etc/telegraf/telegraf.conf',
'pkg_apt:telegraf',
],
}