define network_interface (
$bonding_options = ''
) {
$a = split($name, '\|')
$interface = shift($a)
$bootproto = shift($a)
$ip = shift($a)
$netmask = shift($a)
$bonded = shift($a)
$master_interface = shift($a)
notice "CKM: ${interface}: $bonded - ${master_interface}"
case $bonded {
'true': {
case $master_interface {
'': {
notice "CKM: master interface empty: ${master_interface} -- we should be modprobing"
modprobe { $interface:
type => install,
before => File["ifcfg-${interface}"],
module_options => $operatingsystemrelease ? {
'4' => "/sbin/modprobe bonding -o ${interface} mode=1 primary=eth0",
'5' => "bonding",
},
}
}
}
}
}
file { "ifcfg-${interface}":
name => "/etc/sysconfig/network-scripts/ifcfg-${interface}",
owner => root,
group => root,
mode => 0644,
content => template("network/interface.erb"),
#notify => Exec["manage-interface"],
}
}