bundlewrap/bundles/netdata/metadata.py
Franziska Kunsmann 1339564dc4
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/netdata: introduce, add to home.nas and home.router
2020-11-14 14:05:28 +01:00

28 lines
608 B
Python

defaults = {
'apt': {
'packages': {
'netdata': {},
},
},
}
@metadata_reactor
def iptables(metadata):
interfaces = metadata.get('netdata/restrict_to_interfaces', set())
iptables = []
if len(interfaces):
for iface in sorted(interfaces):
iptables.append(f'iptables -A INPUT -i {iface} -p tcp --dport 19999 -j ACCEPT')
else:
iptables.append('iptables -A INPUT -p tcp --dport 19999 -j ACCEPT')
return {
'iptables': {
'bundle_rules': {
'netdata': iptables,
},
},
}