bundles/netdata: introduce, add to home.nas and home.router
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2020-11-14 14:05:28 +01:00
parent ff607777ce
commit 1339564dc4
Signed by: kunsi
GPG key ID: 12E3D2136B818350
5 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,14 @@
[global]
run as user = netdata
hostname = ${node.name}
memory mode = dbengine
page cache size = 128
dbengine multihost disk space = 2048
[web]
web files owner = root
web files group = root
bind to = 0.0.0.0
[registry]
enabled = no

17
bundles/netdata/items.py Normal file
View file

@ -0,0 +1,17 @@
files = {
'/etc/netdata/netdata.conf': {
'content_type': 'mako',
'triggers': {
'svc_systemd:netdata:restart',
}
},
}
svc_systemd = {
'netdata': {
'needs': {
'pkg_apt:netdata',
'file:/etc/netdata/netdata.conf',
},
},
}

View file

@ -0,0 +1,28 @@
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,
},
},
}

View file

@ -2,6 +2,7 @@ nodes['home.nas'] = {
'hostname': '172.19.138.20', 'hostname': '172.19.138.20',
'bundles': { 'bundles': {
'backup-server', 'backup-server',
'netdata',
'nfs-server', 'nfs-server',
'vmhost', 'vmhost',
'zfs', 'zfs',

View file

@ -4,6 +4,7 @@ nodes['home.router'] = {
'hostname': '172.19.138.1', 'hostname': '172.19.138.1',
'bundles': { 'bundles': {
'iptables', 'iptables',
'netdata',
'pppd', 'pppd',
'radvd', 'radvd',
'dhcpd', 'dhcpd',
@ -52,6 +53,11 @@ nodes['home.router'] = {
'nameservers': atomic({ 'nameservers': atomic({
'9.9.9.10', '9.9.9.10',
}), }),
'netdata': {
'restrict-to-interfaces': {
'enp1s0.42',
},
},
'radvd': { 'radvd': {
'integrate-with-pppd': True, 'integrate-with-pppd': True,
'interfaces': { 'interfaces': {