feat: add networking module

- manage interfaces and routes
- set default params for hosts
- add params class to networking module
- set defaults for debian
This commit is contained in:
2024-06-07 23:30:10 +10:00
parent 33ba0bb896
commit 51eeb13793
4 changed files with 69 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
# unkin networking module
class networking (
Hash $interfaces = {},
Hash $routes = {},
){
include network
include networking::params
$interfaces.each | $interface, $data | {
network_config {$interface:
* => $data,
}
}
$routes.each | $route, $data | {
network_route {$route:
* => $data,
}
}
# prevent DNS from being overwritten by networkmanager
if $networking::params::nwmgr_dns_none {
file {'/etc/NetworkManager/conf.d/dns_none.conf':
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0655',
content => "[main]\ndns=none",
}
}else{
file {'/etc/NetworkManager/conf.d/dns_none.conf':
ensure => 'absent',
}
}
}
+6
View File
@@ -0,0 +1,6 @@
# networking params
class networking::params (
Boolean $nwmgr_dns_none = true,
Boolean $nwmgr_service_running = true,
){
}