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 |
---|
[538] | 21 | exec { "add an interface": |
---|
| 22 | command => "/bin/echo '${content}' >> $file", |
---|
[510] | 23 | unless => "/bin/grep -q '^iface[[:space:]]*${name}[[:space:]]' $file", |
---|
| 24 | notify => Exec["networking"] |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | # XXX: we don't do anything if the file already exists, which means we can't change the IP, for example |
---|
| 28 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.