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

Parameters:

  • slaves (Any)
  • ensure (Any) (defaults to: present)
  • ipaddress (Any) (defaults to: undef)
  • netmask (Any) (defaults to: undef)
  • method (Any) (defaults to: undef)
  • family (Any) (defaults to: undef)
  • onboot (Any) (defaults to: undef)
  • hotplug (Any) (defaults to: undef)
  • mtu (Optional[Variant[Integer[42, 65536],String]]) (defaults to: undef)
  • options (Any) (defaults to: undef)
  • slave_options (Any) (defaults to: undef)
  • mode (Any) (defaults to: undef)
  • miimon (Any) (defaults to: undef)
  • downdelay (Any) (defaults to: undef)
  • updelay (Any) (defaults to: undef)
  • lacp_rate (Any) (defaults to: undef)
  • primary (Any) (defaults to: undef)
  • primary_reselect (Any) (defaults to: undef)
  • xmit_hash_policy (Any) (defaults to: undef)


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],
  }
}