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:
@@ -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',
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# networking params
|
||||
class networking::params (
|
||||
Boolean $nwmgr_dns_none = true,
|
||||
Boolean $nwmgr_service_running = true,
|
||||
){
|
||||
}
|
||||
Reference in New Issue
Block a user