Defined Type: network::bond::debian
- Defined in:
- manifests/bond/debian.pp
Overview
Define: network::bond::debian
Instantiate bonded interfaces on Debian based systems.
See also
-
Debian Network Bonding wiki.debian.org/Bonding
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'manifests/bond/debian.pp', line 8
define network::bond::debian (
$slaves,
$ensure = present,
$ipaddress = undef,
$netmask = undef,
$method = undef,
$family = undef,
$onboot = undef,
$hotplug = undef,
Optional[Variant[Integer[42, 65536],String]] $mtu = undef,
$options = undef,
$slave_options = undef,
$mode = undef,
$miimon = undef,
$downdelay = undef,
$updelay = undef,
$lacp_rate = undef,
$primary = undef,
$primary_reselect = undef,
$xmit_hash_policy = undef,
) {
$raw = {
'bond-slaves' => join($slaves, ' '),
'bond-mode' => $mode,
'bond-miimon' => $miimon,
'bond-downdelay' => $downdelay,
'bond-updelay' => $updelay,
'bond-lacp-rate' => $lacp_rate,
'bond-primary' => $primary,
'bond-primary-reselect' => $primary_reselect,
'bond-xmit-hash-policy' => $xmit_hash_policy,
}
if $mtu =~ String {
warning('$mtu should be an integer and will change in future releases')
}
if $mtu {
# https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1224007
$raw_post_up = { 'post-up' => "ip link set dev ${name} mtu ${mtu}", }
} else {
$raw_post_up = {}
}
$opts = compact_hash(merge($raw, $raw_post_up, $options))
network_config { $name:
ensure => $ensure,
ipaddress => $ipaddress,
netmask => $netmask,
family => $family,
method => $method,
onboot => $onboot,
hotplug => $hotplug,
options => $opts,
}
network_config { $slaves:
ensure => absent,
reconfigure => true,
before => Network_config[$name],
}
}
|