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

BREAKING: replace validate_integer with datatype & drop puppet3 support #220

Merged
merged 1 commit into from
Mar 23, 2017
Merged
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
41 changes: 21 additions & 20 deletions manifests/bond/debian.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,24 @@
# * Debian Network Bonding http://wiki.debian.org/Bonding
define network::bond::debian(
$slaves,
$ensure = present,
$ipaddress = undef,
$netmask = undef,
$method = undef,
$family = undef,
$onboot = undef,
$hotplug = undef,
$mtu = undef,
$options = undef,
$slave_options = undef,

$mode = undef,
$miimon = undef,
$downdelay = undef,
$updelay = undef,
$lacp_rate = undef,
$primary = undef,
$primary_reselect = undef,
$xmit_hash_policy = undef,
$ensure = present,
$ipaddress = undef,
$netmask = undef,
$method = undef,
$family = undef,
$onboot = undef,
$hotplug = undef,
Optional[Variant[Integer[42, 65536],String]] $mtu = undef,
$options = undef,
$slave_options = undef,
$mode = undef,
$miimon = undef,
$downdelay = undef,
$updelay = undef,
$lacp_rate = undef,
$primary = undef,
$primary_reselect = undef,
$xmit_hash_policy = undef,
) {

$raw = {
Expand All @@ -40,9 +39,11 @@
'bond-xmit-hash-policy' => $xmit_hash_policy,
}

if $mtu =~ String {
warning('$mtu should be an integer and will change in future releases')
}
if $mtu {
# https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1224007
validate_integer([$mtu], 65536, 42)
$raw_post_up = { 'post-up' => "ip link set dev ${name} mtu ${mtu}", }
} else {
$raw_post_up = {}
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/bond/debian_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
'ipaddress' => '10.20.2.1',
'netmask' => '255.255.255.192',
'slaves' => %w(eth0 eth1 eth2),
'mtu' => '1550',
'mtu' => 1550,
'options' => { 'bond-future-option' => 'yes' },
'slave_options' => { 'slave-future-option' => 'no' },
'hotplug' => 'false',
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/bond_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'ipaddress' => '172.18.1.2',
'netmask' => '255.255.128.0',
'slaves' => %w(eth0 eth1),
'mtu' => '1550',
'mtu' => 1550,
'options' => { 'NM_CONTROLLED' => 'yes' },
'slave_options' => { 'NM_CONTROLLED' => 'no' },

Expand Down