diff --git a/bundles/linux/items.py b/bundles/linux/items.py index 5229c7f..d3c5b96 100644 --- a/bundles/linux/items.py +++ b/bundles/linux/items.py @@ -25,6 +25,9 @@ files= { 'svc_systemd:systemd-sysctl.service:restart', ], }, + '/etc/modules-load.d/managed.conf': { + 'content': '\n'.join(sorted(node.metadata.get('modules-load'))), + } } svc_systemd = { diff --git a/bundles/linux/metadata.py b/bundles/linux/metadata.py index f6f36f2..b3675d5 100644 --- a/bundles/linux/metadata.py +++ b/bundles/linux/metadata.py @@ -1,3 +1,4 @@ defaults = { 'sysctl': {}, + 'modules-load': set(), } diff --git a/bundles/network/metadata.py b/bundles/network/metadata.py index d9d0d23..c8492ca 100644 --- a/bundles/network/metadata.py +++ b/bundles/network/metadata.py @@ -34,10 +34,12 @@ def dhcp(metadata): @metadata_reactor.provides( 'systemd/units', + 'modules-load', ) def units(metadata): if node.has_bundle('systemd-networkd'): units = {} + modules_load = set() for network_name, network_conf in metadata.get('network').items(): interface_type = network_conf.get('type', None) @@ -96,13 +98,15 @@ def units(metadata): # cake WIP - # if 'cake' in network_conf: - # units[f'{network_name}.network']['CAKE'] = network_conf['cake'] + if 'cake' in network_conf: + units[f'{network_name}.network']['CAKE'] = network_conf['cake'] + modules_load.add('sch_cake') return { 'systemd': { 'units': units, - } + }, + 'modules-load': modules_load, } else: return {} diff --git a/bundles/pppoe/items.py b/bundles/pppoe/items.py index c79c279..d0a7dc8 100644 --- a/bundles/pppoe/items.py +++ b/bundles/pppoe/items.py @@ -1,8 +1,4 @@ files = { - '/etc/modules-load.d/pppoe.conf': { - 'content': 'pppoe\npppox\nppp_generic', - 'mode': '0644', - }, '/etc/ppp/peers/isp': { 'content_type': 'mako', 'mode': '0644', diff --git a/bundles/pppoe/metadata.py b/bundles/pppoe/metadata.py index 8a49ff4..2a208b4 100644 --- a/bundles/pppoe/metadata.py +++ b/bundles/pppoe/metadata.py @@ -4,6 +4,11 @@ defaults = { 'pppoe': {}, }, }, + 'modules-load': { + 'pppoe', + 'pppox', + 'ppp_generic', + }, 'nftables': { 'nat': { 'oifname ppp0 masquerade', diff --git a/nodes/ovh.secondary.py b/nodes/ovh.secondary.py index a3c951f..0714cf7 100644 --- a/nodes/ovh.secondary.py +++ b/nodes/ovh.secondary.py @@ -17,6 +17,11 @@ 'gateway4': '51.68.188.1', 'ipv6': '2001:41d0:701:1100::751a/128', 'gateway6': '2001:41d0:701:1100::1', + 'cake': { + 'Bandwidth': '350M', + 'FlowIsolationMode': 'triple', + 'RTTSec': '100ms', + }, }, }, 'bind': {