Last change
on this file since 594 was
545,
checked in by sebas, 15 years ago
|
formateo segun la guia de estilo de puppet
|
File size:
1.4 KB
|
Rev | Line | |
---|
[510] | 1 | import "network/os/*.pp" |
---|
| 2 | |
---|
| 3 | class network { |
---|
| 4 | |
---|
| 5 | } |
---|
| 6 | |
---|
| 7 | # configure an interface with the given options |
---|
| 8 | # $parameters are platform dependent extras |
---|
| 9 | define network::interface ( $address, $netmask, $broadcast = "NONE", $parameters = "" ) { |
---|
| 10 | case $operatingsystem { |
---|
| 11 | OpenBSD: { |
---|
| 12 | network::interface::openbsd { $name: |
---|
[545] | 13 | address => $address, |
---|
| 14 | netmask => $netmask, |
---|
| 15 | broadcast => $broadcast, |
---|
[510] | 16 | parameters => $parameters, |
---|
| 17 | } |
---|
| 18 | } |
---|
| 19 | Debian: { |
---|
| 20 | network::interface::debian { $name: |
---|
[545] | 21 | address => $address, |
---|
| 22 | netmask => $netmask, |
---|
| 23 | broadcast => $broadcast, |
---|
[510] | 24 | parameters => $parameters, |
---|
| 25 | } |
---|
| 26 | } |
---|
| 27 | Ubuntu: { |
---|
| 28 | network::interface::debian { $name: |
---|
[545] | 29 | address => $address, |
---|
| 30 | netmask => $netmask, |
---|
| 31 | broadcast => $broadcast, |
---|
[510] | 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 |
---|
| 42 | define network::vlan ( $vtag, $device, $address, $netmask, $broadcast = "NONE", $parameters = "" ) { |
---|
| 43 | case $operatingsystem { |
---|
| 44 | OpenBSD: { |
---|
| 45 | network::interface { $name: |
---|
[545] | 46 | address => $address, |
---|
| 47 | netmask => $netmask, |
---|
| 48 | broadcast => $broadcast, |
---|
[510] | 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.