Defined Type: interface::aggregate_member

Defined in:
modules/interface/manifests/aggregate_member.pp

Overview

Parameters:

  • master (Any)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'modules/interface/manifests/aggregate_member.pp', line 1

define interface::aggregate_member($master) {
    require_package('ifenslave-2.6')

    $interface = $title

    augeas { "aggregate member ${interface}":
        context => '/files/etc/network/interfaces/',
        changes => [
                "set auto[./1 = '${interface}']/1 '${interface}'",
                "set iface[. = '${interface}'] '${interface}'",
                "set iface[. = '${interface}']/family 'inet'",
                "set iface[. = '${interface}']/method 'manual'",
        ],
        notify  => Exec["ifup ${interface}"]
    }

    exec { "ifup ${interface}":
        command     => "/sbin/ifup --force ${interface}; /sbin/ip link set dev ${interface} up",
        require     => Augeas["aggregate member ${interface}"],
        refreshonly => true
    }
}