source: trunk/puppet/modules/puppet-network/manifests/init.pp @ 542

Last change on this file since 542 was 510, checked in by sebas, 15 years ago

fork del modulo network de Koumbit

File size: 1.4 KB
RevLine 
[510]1import "network/os/*.pp"
2
3class network {
4
5}
6
7# configure an interface with the given options
8# $parameters are platform dependent extras
9define network::interface ( $address, $netmask, $broadcast = "NONE", $parameters = "" ) {
10  case $operatingsystem {
11    OpenBSD: {
12      network::interface::openbsd { $name:
13        address => $address,
14        netmask => $netmask,
15        broadcast => $broadcast,
16        parameters => $parameters,
17      }
18    }
19    Debian: {
20      network::interface::debian { $name:
21        address => $address,
22        netmask => $netmask,
23        broadcast => $broadcast,
24        parameters => $parameters,
25      }
26    }
27    Ubuntu: {
28      network::interface::debian { $name:
29        address => $address,
30        netmask => $netmask,
31        broadcast => $broadcast,
32        parameters => $parameters,
33      }
34    }
35    default: {
36      err("Network interface configuration not supported in $operatingsystem")
37    }
38  }
39}
40
41# configure a tagged vlan on the given interface
42define network::vlan ( $vtag, $device, $address, $netmask, $broadcast = "NONE", $parameters = "" ) {
43  case $operatingsystem {
44    OpenBSD: {
45      network::interface { $name:
46        address => $address,
47        netmask => $netmask,
48        broadcast => $broadcast,
49        parameters => "vlan $vtag vlandev $device $parameters"
50      }
51    }
52    default: {
53      err("VLANs not supported in $operatingsystem")
54    }
55  }
56}
Note: See TracBrowser for help on using the repository browser.