Perhaps I'm not understanding what you are asking, but I've got this
class "network::interface":

class network::interface( $device,
                          $bootproto = 'static',
                          $hwaddr,
                          $ipaddr,
                          $ipv6init = 'yes',
                          $mtu = '1500',
                          $netmask,
                          $onboot = 'yes' ) inherits network {

  # Create the device definition file
  file { "/etc/sysconfig/network-scripts/ifcfg-$device":
    content => template('network/ifcfg.erb'),
  }

  # Ifdown and ifup the new interface upon changes
  exec { "ifdown-ifup-$device":
    user        => 'root',
    path        => '/etc/sysconfig/network-scripts:/bin:/usr/bin:/
sbin:/usr/sbin',
    command     => "/sbin/ifdown $device ; /sbin/ifup $device",
    refreshonly => true,
    subscribe   => File["/etc/sysconfig/network-scripts/ifcfg-
$device"],
  }

}

... and the template:


# This file is created by puppet
# DO NOT HAND-EDIT
DEVICE="<%= device %>"
BOOTPROTO="<%= bootproto %>"
<% if has_variable?("gateway") then -%>
GATEWAY="<%= gateway %>"
<% end -%>
HWADDR="<%= hwaddr %>"
IPADDR="<%= ipaddr %>"
IPV6INIT="<%= ipv6init %>"
MTU="<%= mtu %>"
NETMASK="<%= netmask %>"
ONBOOT="<%= onboot %>"

Is this what you are looking for?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to