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

Last change on this file was 545, checked in by sebas, 14 years ago

formateo segun la guia de estilo de puppet

File size: 788 bytes
RevLine 
[510]1class network::debian {
2  exec { "networking":
[545]3    command     => "/usr/sbin/invoke-rc.d networking restart",
4    logoutput   => true,
[510]5    refreshonly => true,
6  }
7
8  package {"resolvconf":
[545]9    ensure => installed,
[510]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
[538]21  exec { "add an interface":
22    command => "/bin/echo '${content}' >> $file",
[545]23    unless  => "/bin/grep -q '^iface[[:space:]]*${name}[[:space:]]' $file",
24    notify  => Exec["networking"]
[510]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.