diff --git a/manifests/if/static.pp b/manifests/if/static.pp index f4010e2..f66ece1 100644 --- a/manifests/if/static.pp +++ b/manifests/if/static.pp @@ -36,7 +36,7 @@ # domain => 'is.domain.com domain.com', # ipv6init => true, # ipv6address => '123:4567:89ab:cdef:123:4567:89ab:cdef' -# ipv6gateway => '123:4567:89ab:cdef:123:4567:89ab:1' +# ipv6gateway => '123:4567:89ab:cdef:123:4567:89ab:1' # } # # === Authors: @@ -49,8 +49,8 @@ # define network::if::static ( $ensure, - $ipaddress, - $netmask, + $ipaddress = '', + $netmask = '', $gateway = '', $ipv6address = '', $ipv6init = false, @@ -65,10 +65,11 @@ $dns1 = '', $dns2 = '', $domain = '', - $linkdelay = '' + $linkdelay = '', + $vlan = false, ) { # Validate our data - if ! is_ip_address($ipaddress) { fail("${ipaddress} is not an IP address.") } + if !empty($ipaddress) and ! is_ip_address($ipaddress) { fail("${ipaddress} is not an IP address.") } if $ipv6address != '' { if ! is_ip_address($ipv6address) { fail("${ipv6address} is not an IPv6 address.") } } @@ -107,5 +108,6 @@ dns2 => $dns2, domain => $domain, linkdelay => $linkdelay, + vlan => $vlan, } } # define network::if::static diff --git a/manifests/init.pp b/manifests/init.pp index 6f09260..b96ef2d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -94,8 +94,8 @@ # define network_if_base ( $ensure, - $ipaddress, - $netmask, + $ipaddress = '', + $netmask = '', $macaddress, $gateway = '', $ipv6address = '', @@ -116,6 +116,7 @@ $domain = '', $bridge = '', $linkdelay = '', + $vlan = false, ) { # Validate our booleans validate_bool($userctl) diff --git a/templates/ifcfg-eth.erb b/templates/ifcfg-eth.erb index 1940e10..3bddc7d 100644 --- a/templates/ifcfg-eth.erb +++ b/templates/ifcfg-eth.erb @@ -50,4 +50,6 @@ IPV6INIT=yes <% end -%> <% if !@linkdelay.empty? %>LINKDELAY=<%= @linkdelay %> <% end -%> +<% if !@vlan.empty? %>VLAN=<%= @vlan %> +<% end -%> NM_CONTROLLED=no