bundlewrap/bundles/mosquitto/metadata.py

43 lines
880 B
Python
Raw Normal View History

from bundlewrap.metadata import atomic
defaults = {
'apt': {
'packages': {
'mosquitto': {},
'mosquitto-clients': {},
},
},
2021-04-03 07:43:24 +00:00
'icinga2_api': {
'mosquitto': {
'services': {
'MOSQUITTO PROCESS': {
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -C mosquitto -c 1:',
},
},
},
},
'mosquitto': {
'listeners': {
'1883': {},
},
},
}
@metadata_reactor.provides(
'iptables/port_rules',
)
def iptables(metadata):
sources = metadata.get('mosquitto/restrict-to', {'*'})
result = {}
for listener in metadata.get('mosquitto/listeners').keys():
result[listener] = atomic(sources)
return {
'iptables': {
'port_rules': result,
},
}