import "network/os/*.pp" class network { } # configure an interface with the given options # $parameters are platform dependent extras define network::interface ( $address, $netmask, $broadcast = "NONE", $parameters = "" ) { case $operatingsystem { OpenBSD: { network::interface::openbsd { $name: address => $address, netmask => $netmask, broadcast => $broadcast, parameters => $parameters, } } Debian: { network::interface::debian { $name: address => $address, netmask => $netmask, broadcast => $broadcast, parameters => $parameters, } } Ubuntu: { network::interface::debian { $name: address => $address, netmask => $netmask, broadcast => $broadcast, parameters => $parameters, } case $lsbdistcodename { Lucid: { # Por bug: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/448095 # Recargamos nuevamente las placas de red $rclocal = "/etc/init.d/rc.local" file { "$rclocal" : ensure => present, } line { "cambiamos rc.local": file => "$rclocal" , line => "ifdown -a; ifup -a", ensure => present, } } } } default: { err("Network interface configuration not supported in $operatingsystem") } } } # configure a tagged vlan on the given interface define network::vlan ( $vtag, $device, $address, $netmask, $broadcast = "NONE", $parameters = "" ) { case $operatingsystem { OpenBSD: { network::interface { $name: address => $address, netmask => $netmask, broadcast => $broadcast, parameters => "vlan $vtag vlandev $device $parameters" } } default: { err("VLANs not supported in $operatingsystem") } } }