source: trunk/puppet/modules/puppet-network/manifests/os/debian.pp @ 538

Last change on this file since 538 was 538, checked in by sebas, 12 years ago

mejor exec definicion

File size: 783 bytes
Line 
1class 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
14define 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 { "add an interface":
22    command => "/bin/echo '${content}' >> $file",
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.