bundles/mosquitto: only install telegraf plugin if we have telegraf

This commit is contained in:
Franzi 2024-07-30 17:54:24 +02:00
parent b1790ece35
commit 7649396b8a
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 11 additions and 9 deletions

View file

@ -5,12 +5,6 @@ files = {
'svc_systemd:mosquitto:restart', 'svc_systemd:mosquitto:restart',
}, },
}, },
'/usr/local/bin/tasmota-telegraf-plugin': {
'mode': '0755',
'needs': {
'pkg_apt:python3-paho-mqtt',
},
},
} }
svc_systemd = { svc_systemd = {
@ -23,6 +17,12 @@ svc_systemd = {
} }
if node.has_bundle('telegraf'): if node.has_bundle('telegraf'):
files['/usr/local/bin/tasmota-telegraf-plugin']['triggers'] = { files['/usr/local/bin/tasmota-telegraf-plugin'] = {
'mode': '0755',
'needs': {
'pkg_apt:python3-paho-mqtt',
},
'triggers': {
'svc_systemd:telegraf:restart', 'svc_systemd:telegraf:restart',
},
} }

View file

@ -5,7 +5,6 @@ defaults = {
'packages': { 'packages': {
'mosquitto': {}, 'mosquitto': {},
'mosquitto-clients': {}, 'mosquitto-clients': {},
'python3-paho-mqtt': {}, # for telegraf plugin
}, },
}, },
'icinga2_api': { 'icinga2_api': {
@ -24,6 +23,9 @@ defaults = {
}, },
} }
if node.has_bundle('telegraf'):
defaults['apt']['packages']['python3-paho-mqtt'] = {}
@metadata_reactor.provides( @metadata_reactor.provides(
'firewall/port_rules', 'firewall/port_rules',