bundles: add some telegraf plugins

This commit is contained in:
Franzi 2021-04-23 19:31:28 +02:00
parent 5e0541aef8
commit a37d31973a
Signed by: kunsi
GPG key ID: 12E3D2136B818350
12 changed files with 159 additions and 0 deletions

View file

@ -27,3 +27,26 @@ def add_vlan_infos_to_interface(metadata):
return {
'interfaces': interfaces,
}
@metadata_reactor.provides(
'telegraf/input_plugins/builtin/bond',
)
def telegraf(metadata):
if not node.has_bundle('telegraf'):
raise DoNotRunAgain
if metadata.get('systemd-networkd/bonds', {}):
return {
'telegraf': {
'input_plugins': {
'builtin': {
'bond': [{
'bond_interfaces': list(sorted(metadata.get('systemd-networkd/bonds').keys())),
}],
},
},
},
}
return {}