Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Interface VLAN Support, and support for interface without IP addr #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions manifests/if/static.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -49,8 +49,8 @@
#
define network::if::static (
$ensure,
$ipaddress,
$netmask,
$ipaddress = '',
$netmask = '',
$gateway = '',
$ipv6address = '',
$ipv6init = false,
Expand All @@ -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.") }
}
Expand Down Expand Up @@ -107,5 +108,6 @@
dns2 => $dns2,
domain => $domain,
linkdelay => $linkdelay,
vlan => $vlan,
}
} # define network::if::static
5 changes: 3 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
#
define network_if_base (
$ensure,
$ipaddress,
$netmask,
$ipaddress = '',
$netmask = '',
$macaddress,
$gateway = '',
$ipv6address = '',
Expand All @@ -116,6 +116,7 @@
$domain = '',
$bridge = '',
$linkdelay = '',
$vlan = false,
) {
# Validate our booleans
validate_bool($userctl)
Expand Down
2 changes: 2 additions & 0 deletions templates/ifcfg-eth.erb
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@ IPV6INIT=yes
<% end -%>
<% if [email protected]? %>LINKDELAY=<%= @linkdelay %>
<% end -%>
<% if [email protected]? %>VLAN=<%= @vlan %>
<% end -%>
NM_CONTROLLED=no