Skip to content

Commit

Permalink
Basic IPv6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
erwbgy committed Mar 19, 2013
1 parent f15565c commit ff4e48c
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 14 deletions.
7 changes: 6 additions & 1 deletion Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
* Manage simple mail smart host configuration (initially just Postfix). Mail
aliases are now set under 'mail' instead of a separate 'mailaliases'.

* Do not try to set a MAC address on a virtual interface. Instead make virtual
interfaces dependent on their parents (#3 thanks eglis).

* Added basic IPv6 support (#2 thanks eglis)

0.7.2:

* Realize groups before users so that user primary groups exist when the user
is created.

* Make 'include system' work again (thanks mkm85) by avoiding mandatory
* Make 'include system' work again (#1 thanks mkm85) by avoiding mandatory
parameters in network and adding checks instead.

* Do not restart the network service when config file changes are made as this
Expand Down
10 changes: 6 additions & 4 deletions manifests/network.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
class system::network (
$hostname = undef,
$gateway = undef,
$ipv6 = false,
$zeroconf = false,
$hostname = undef,
$gateway = undef,
$ipv6 = false,
$ipv6init = false,
$ipv6autoconf = true,
$zeroconf = false,
) {
if $hostname {
validate_string($hostname)
Expand Down
27 changes: 19 additions & 8 deletions manifests/network/interface.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
define system::network::interface (
$dhcp = undef,
$hwaddr = undef,
$hotplug = true,
$ipaddress = undef,
$netmask = undef,
$onboot = true,
$routes = undef,
$type = 'Ethernet',
$dhcp = undef,
$hwaddr = undef,
$hotplug = true,
$ipaddress = undef,
$ipv6init = false,
$ipv6addr = undef,
$ipv6addr_secondaries = undef,
$ipv6autoconf = true,
$netmask = undef,
$onboot = true,
$routes = undef,
$type = 'Ethernet',
$userctl = false,
) {
$_interface = $title
validate_string($_interface)
Expand Down Expand Up @@ -48,6 +53,12 @@
else {
$_alias = false
}
$_ipv6init = $ipv6init
validate_bool($_ipv6init)
$_ipv6addr = $ipv6addr
$_ipv6addr_secondaries = $ipv6addr_secondaries
$_ipv6autoconf = $ipv6autoconf
validate_bool($_ipv6autoconf)
file { "/etc/sysconfig/network-scripts/ifcfg-${_interface}":
ensure => present,
owner => 'root',
Expand Down
6 changes: 6 additions & 0 deletions templates/network/interface.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ HOTPLUG=<% if @_hotplug %>yes<% else %>no<% end %>
TYPE=<%= @_type %>
IPADDR=<%= @_ipaddr %>
NETMASK=<%= @_netmask %>
<% if @_ipv6init -%>
IPV6INIT=yes
<% if @_ipv6addr %>IPV6ADDR=<%= @_ipv6addr %><% end %>
<% if @_ipv6addr_secondaries %>IPV6ADDR_SECONDARIES=<%= @_ipv6addr_secondaries %><% end %>
IPV6_AUTOCONF=<% if @_ipv6autoconf %>yes<% else %>no<% end %>
<% end -%>
8 changes: 7 additions & 1 deletion templates/network/network.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# File managed by Puppet
NETWORKING=yes
NETWORKING_IPV6=<% if @ipv6 %>yes<% else %>no<% end %>
HOSTNAME=<%= @hostname %>
GATEWAY=<%= @gateway %>
NOZEROCONF=<% if @zeroconf %>no<% else %>yes<% end %>
<% if @ipv6 -%>
NETWORKING_IPV6=yes
<% if @ipv6init %>IPV6INIT=yes<% end %>
IPV6_AUTOCONF=<% if @ipv6autoconf %>yes<% else %>no<% end %>
<% else -%>
NETWORKING_IPV6=no
<% end -%>

0 comments on commit ff4e48c

Please sign in to comment.