Last change
on this file since 534 was
510,
checked in by sebas, 15 years ago
|
fork del modulo network de Koumbit
|
File size:
748 bytes
|
Rev | Line | |
---|
[510] | 1 | class network::debian { |
---|
| 2 | exec { "networking": |
---|
| 3 | command => "/usr/sbin/invoke-rc.d networking restart", |
---|
| 4 | logoutput => true, |
---|
| 5 | refreshonly => true, |
---|
| 6 | } |
---|
| 7 | |
---|
| 8 | package {"resolvconf": |
---|
| 9 | ensure => installed, |
---|
| 10 | } |
---|
| 11 | |
---|
| 12 | } |
---|
| 13 | |
---|
| 14 | define network::interface::debian ( $address, $netmask, $broadcast = "NONE", $parameters = "", $auto = true ) { |
---|
| 15 | include network::debian |
---|
| 16 | |
---|
| 17 | $content = template("network/debian.erb") |
---|
| 18 | $file = "/etc/network/interfaces" |
---|
| 19 | |
---|
| 20 | # add an interface line if doesn't exist |
---|
| 21 | exec { "/bin/echo '${content}' >> $file": |
---|
| 22 | unless => "/bin/grep -q '^iface[[:space:]]*${name}[[:space:]]' $file", |
---|
| 23 | notify => Exec["networking"] |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | # XXX: we don't do anything if the file already exists, which means we can't change the IP, for example |
---|
| 27 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.