Skip to content

Commit dfc473f

Browse files
committed
Fix test failures and update Gemfile for Puppet 8 compatibility
- Fix netplan_apply exec always present even when disabled - Fix wakeonwlan enum in wifis.epp missing most valid values - Fix learn_packet_interval type mismatch (String vs Variant) in bonds.epp - Fix tunnel link type (Integer vs String) in manifest and template - Fix trailing space in checksums enum in tunnels.epp - Fix wifis_spec access_points format (Array vs Hash) - Replace legacy version-specific Gemfile deps with direct gems
1 parent 1496772 commit dfc473f

7 files changed

Lines changed: 25 additions & 31 deletions

File tree

Gemfile

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,12 @@ def location_for(place_or_version, fake_version = nil)
1313
end
1414
end
1515

16-
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
17-
minor_version = ruby_version_segments[0..1].join('.')
18-
1916
group :development do
20-
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
21-
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
22-
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
23-
gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
24-
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
25-
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
26-
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
27-
end
28-
group :system_tests do
29-
gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
30-
gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
17+
gem 'puppet-lint', require: false
18+
gem 'puppetlabs_spec_helper', require: false
19+
gem 'rspec-puppet', require: false
20+
gem 'rspec-puppet-facts', require: false
21+
gem 'voxpupuli-puppet-lint-plugins', require: false
3122
end
3223

3324
puppet_version = ENV['PUPPET_GEM_VERSION']

manifests/init.pp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,16 @@
6363
}
6464
}
6565

66-
$notify = $netplan_apply ? {
67-
true => Exec['netplan_apply'],
68-
default => undef,
69-
}
66+
if $netplan_apply {
67+
exec { 'netplan_apply':
68+
command => '/usr/sbin/netplan apply',
69+
logoutput => 'on_failure',
70+
refreshonly => true,
71+
}
7072

71-
exec { 'netplan_apply':
72-
command => '/usr/sbin/netplan apply',
73-
logoutput => 'on_failure',
74-
refreshonly => true,
73+
$notify = Exec['netplan_apply']
74+
} else {
75+
$notify = undef
7576
}
7677

7778
concat { $netplan::config_file:

manifests/tunnels.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@
351351
}]]] $peers = undef,
352352
# VXLAN specific keys
353353
Optional[Integer[1,16777215]] $id = undef,
354-
Optional[Integer] $link = undef,
354+
Optional[String] $link = undef,
355355
Optional[Integer] $type_of_service = undef,
356356
Optional[Boolean] $mac_learning = undef,
357357
Optional[Integer] $ageing = undef,

spec/defines/wifis_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@
2626
let(:params) do
2727
{
2828
dhcp4: true,
29-
access_points: [
30-
{
31-
'ssid' => 'MyNetwork',
29+
access_points: {
30+
'MyNetwork' => {
3231
'password' => 'secret123',
3332
},
34-
],
33+
},
3534
}
3635
end
3736

templates/bonds.epp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
Optional['packets_per_member'] => Integer,
105105
Optional['primary_reselect_policy'] => Enum['always', 'better', 'failure'],
106106
Optional['resend_igmp'] => Integer,
107-
Optional['learn_packet_interval'] => String,
107+
Optional['learn_packet_interval'] => Variant[Integer, Float],
108108
Optional['primary'] => String,
109109
}]] $parameters = undef,
110110

templates/tunnels.epp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
}]]] $peers = undef,
109109
# VXLAN specific keys
110110
Optional[Integer[1,16777215]] $id = undef,
111-
Optional[Integer] $link = undef,
111+
Optional[String] $link = undef,
112112
Optional[Integer] $type_of_service = undef,
113113
Optional[Boolean] $mac_learning = undef,
114114
Optional[Integer] $ageing = undef,
@@ -117,7 +117,7 @@
117117
Optional[Enum['l2-miss', 'l3-miss']] $notifications = undef,
118118
Optional[Boolean] $short_circuit = undef,
119119
Optional[Enum['udp', 'zero-udp6-tx', 'zero-udp6-rx',
120-
'remote-tx', 'remote-rx ']] $checksums = undef,
120+
'remote-tx', 'remote-rx']] $checksums = undef,
121121
Optional[Enum['group-policy', 'generic-protocol']] $extensions = undef,
122122
Optional[Tuple[Stdlib::Port, Stdlib::Port]] $port_range = undef,
123123
Optional[Integer[1,1048575]] $flow_label = undef,

templates/wifis.epp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@
139139
Optional['phase2_auth'] => String,
140140
}]
141141
}]]] $access_points = undef,
142-
Optional[Array[Enum['any', 'disconnect']]] $wakeonwlan = undef,
142+
Optional[Array[Enum['any', 'disconnect', 'magic_pkt',
143+
'gtk_rekey_failure', 'eap_identity_req',
144+
'four_way_handshake', 'rfkill_release',
145+
'tcp', 'default']]] $wakeonwlan = undef,
143146
Optional[String] $regulatory_domain = undef,
144147

145148
| -%>

0 commit comments

Comments
 (0)