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

Last change on this file since 729 was 642, checked in by josx@…, 15 years ago

Por BUG https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/448095 de Resolvconf tenemos que recargar las placas de red para LUCID

File size: 1.9 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:
[642]13        address => $address,
14        netmask => $netmask,
15        broadcast => $broadcast,
[510]16        parameters => $parameters,
17      }
18    }
19    Debian: {
20      network::interface::debian { $name:
[642]21        address => $address,
22        netmask => $netmask,
23        broadcast => $broadcast,
[510]24        parameters => $parameters,
25      }
26    }
27    Ubuntu: {
28      network::interface::debian { $name:
[642]29        address => $address,
30        netmask => $netmask,
31        broadcast => $broadcast,
[510]32        parameters => $parameters,
33      }
[642]34      case $lsbdistcodename {
35        Lucid: {
36            # Por bug: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/448095
37            # Recargamos nuevamente las placas de red
38            $rclocal = "/etc/init.d/rc.local"
39            file { "$rclocal"  : ensure => present, }
40            line { "cambiamos rc.local":
41                file   => "$rclocal" ,
42                line   => "ifdown -a; ifup -a",
43                ensure => present,
44            }
45
46        }
47      }
48    }
[510]49    default: {
50      err("Network interface configuration not supported in $operatingsystem")
51    }
52  }
53}
54
55# configure a tagged vlan on the given interface
56define network::vlan ( $vtag, $device, $address, $netmask, $broadcast = "NONE", $parameters = "" ) {
57  case $operatingsystem {
58    OpenBSD: {
59      network::interface { $name:
[642]60        address => $address,
61        netmask => $netmask,
62        broadcast => $broadcast,
[510]63        parameters => "vlan $vtag vlandev $device $parameters"
64      }
65    }
66    default: {
67      err("VLANs not supported in $operatingsystem")
68    }
69  }
70}
Note: See TracBrowser for help on using the repository browser.