Probably better to use network::interface, so you can add support for other
network resources.

Also:

https://github.com/ohlol/puppet-network

Old, out of date, not complete, but it's a start.

On Tue, Mar 1, 2011 at 5:50 PM, Eric Sorenson <eric.soren...@me.com> wrote:

> Hi - I've searched around and haven't found anyone who's implemented a
> type+provider for configuring network interfaces in puppet.  Does anyone
> have such a thing already running that's just not on forge / github? I found
> some prior art (aside from the old 'interface' type which was deleted in
> 0.24) but most people seem to use definitions + templates which isn't a good
> "first class citizen" solution.
>
> I and other puppet hackers around my organization worked up a strawman
> proposal that we thought would be a reasonable interface and I figured I
> would float it by the list. Obviously it's a complicated beast but this
> would be great functionality to have in puppet. I'll update
> https://projects.puppetlabs.com/issues/3153 with the results of the
> discussion here and maybe we can get some traction on it.
>
>  - Eric Sorenson - N37 17.255 W121 55.738  - http://twitter.com/ahpook  -
>
>
> ### basic examples
> networkinterface { "eth0":
>   ensure    => enabled,
>   bootproto => dhcp,    # required for DHCP/BOOTP, optional for static
>   hwaddr    => "00:aa:bb:cc:dd:ee"
> }
>
> networkinterface { "eth0":
>   ensure      => "enabled",  # sets ONBOOT=true, causes ifup refresh
>   hwaddr      => "00:aa:bb:cc:dd:ee"
>   ipaddress   => "10.0.0.2",
>   netmask     => "255.255.255.0",
>   gateway     => "10.0.0.1",
> }
>
> ### vlan example
> networkinterface { "vlan201":
>   ensure      => "enabled",
>   ipaddress   => "10.0.0.3",
>   netmask     => "255.255.255.0",
>   gateway     => "10.0.0.1",
>   vlantag     => "201",   # 1 through 4096
>   physicaldev => "eth0",  # parent device, need this or hwaddr
>   # not too happy about this, but IMO the yum 'enablerepo' example
>   # shows there is a need to pass arbitrary provider-specific args
>   # i.e. the RH sysvinit provider would turn " " to \n and
>   # drop these into the network-scripts file.
>   # This particular option enables '/dev/vlan201' instead of
> '/dev/eth0.201'
>   extra_opts   => "VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD PEERDNS=NO
> PEERNTP=NO"
> }
>
> ### bonding example - master interface with two slaves
> networkinterface { "bond0":
>   ensure      => "enabled",
>   ipaddress   => "10.0.0.4",
>   netmask     => "255.255.255.0",
>   gateway     => "10.0.0.1",
>   # rather than support a crapload of attributes like "bond_mode =>
> active_backup",
>   # use the new-style BONDING_OPTS variable
>   extra_opts => "BONDING_OPTS='mode=active-backup arp_interval=60
> arp_ip_target=192.168.1.254'"
> }
> # slave interfaces for the bond
> networkinterface { "eth0":
>   ensure      => enabled,
>   bond_master => bond0,
> }
> networkinterface  { "eth1":
>   ensure      => enabled,
>   bond_master => bond0,
> }
>
> ### ip aliases
> # this requires a unique namevar so you couldn't model solaris
> # or iproute2-style secondary addresses without composite keys
> networkinterface { "bge0:1":
>   ensure    => enabled,
>   ipaddress => "10.0.0.5",
>   netmask   => "255.255.255.0",
>   gateway   => "10.0.0.1",
> }
>
>
>
>  --
> 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.
>

-- 
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