- manage interfaces and routes - set default params for hosts - add params class to networking module - set defaults for debian
36 lines
735 B
Puppet
36 lines
735 B
Puppet
# 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',
|
|
}
|
|
}
|
|
}
|