Added support for bridge interfaces on Centos and Fedora

This commit is contained in:
Ossi Salmi 2011-07-20 00:43:05 +03:00 committed by Timo Mkinen
parent c64947271f
commit 6013834928
2 changed files with 17 additions and 2 deletions

View file

@ -112,6 +112,8 @@ class network::hostname {
# Defaults to none.
# $ip6netmask:
# IPv6 netmask length. Defaults to 64.
# $bridge:
# Array of interfaces to add to bridge.
# $options:
# Custom options for interface (used only on OpenBSD).
# $postcmd:
@ -125,7 +127,9 @@ class network::hostname {
# netmask => "255.255.0.0",
# }
#
define network::interface($options = [], $ipaddr = "none", $eaddr = "none", $netmask = "none", $ip6addr = "none", $ip6netmask = "64", $postcmd = []) {
define network::interface($ipaddr = "none", $eaddr = "none", $netmask = "none",
$ip6addr = "none", $ip6netmask = "64",
$bridge = [], $options = [], $postcmd = []) {
include network::helper::restart
@ -162,6 +166,12 @@ define network::interface($options = [], $ipaddr = "none", $eaddr = "none", $net
}
}
centos,fedora: {
if $bridge {
network::interface { $bridge:
options => [ "BRIDGE=${name}", "LINKDELAY=10" ],
before => Exec["restart-interface-${name}"],
}
}
file { "/etc/sysconfig/network-scripts/ifcfg-${name}":
ensure => present,
content => template("network/ifcfg-if.erb"),