Skip to content

Commit 8c96a8a

Browse files
authored
BREAKING: Updates, Drop Puppet 6 and add Puppet 8 support (#21)
1 parent 11a29ff commit 8c96a8a

File tree

18 files changed

+88
-93
lines changed

18 files changed

+88
-93
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- master
88
pull_request:
99

10+
1011
jobs:
1112
unit:
1213
runs-on: ubuntu-latest
@@ -15,27 +16,27 @@ jobs:
1516
fail-fast: false
1617
matrix:
1718
include:
18-
- ruby: 2.5.7
19-
puppet: 6
19+
- ruby: 2.7.7
20+
puppet: 7
2021
fixtures: .fixtures.yml
2122
allow_failure: false
22-
- ruby: 2.7.0
23-
puppet: 7
23+
- ruby: 3.2.2
24+
puppet: 8
2425
fixtures: .fixtures.yml
2526
allow_failure: false
2627
env:
2728
BUNDLE_WITHOUT: system_tests:release
2829
PUPPET_GEM_VERSION: "~> ${{ matrix.puppet }}.0"
29-
FACTER_GEM_VERSION: "< 4.0"
3030
FIXTURES_YML: ${{ matrix.fixtures }}
3131
name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
3232
steps:
33-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v3
3434
- name: Setup ruby
3535
uses: ruby/setup-ruby@v1
3636
with:
3737
ruby-version: ${{ matrix.ruby }}
3838
bundler-cache: true
39+
cache-version: 2
3940
bundler: '2.1.0'
4041
- name: Validate
4142
run: bundle exec rake check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout repository
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1818
- name: Setup Ruby
1919
uses: ruby/setup-ruby@v1
2020
with:

.rubocop.yml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
require:
33
- rubocop-rspec
4-
- rubocop-i18n
54
AllCops:
65
DisplayCopNames: true
7-
TargetRubyVersion: '2.1'
6+
TargetRubyVersion: '2.5'
87
Include:
9-
- "./**/*.rb"
8+
- "**/*.rb"
109
Exclude:
1110
- bin/*
1211
- ".vendor/**/*"
@@ -21,13 +20,6 @@ AllCops:
2120
Metrics/LineLength:
2221
Description: People have wide screens, use them.
2322
Max: 200
24-
GetText:
25-
Enabled: false
26-
GetText/DecorateString:
27-
Description: We don't want to decorate test output.
28-
Exclude:
29-
- spec/**/*
30-
Enabled: false
3123
RSpec/BeforeAfterAll:
3224
Description: Beware of using after(:all) as it may cause state to leak between tests.
3325
A necessary evil in acceptance testing.
@@ -40,10 +32,6 @@ Style/BlockDelimiters:
4032
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
4133
be consistent then.
4234
EnforcedStyle: braces_for_chaining
43-
Style/BracesAroundHashParameters:
44-
Description: Braces are required by Ruby 2.7. Cop removed from RuboCop v0.80.0.
45-
See https://github.com/rubocop-hq/rubocop/pull/7643
46-
Enabled: true
4735
Style/ClassAndModuleChildren:
4836
Description: Compact style reduces the required amount of indentation.
4937
EnforcedStyle: compact
@@ -72,13 +60,16 @@ Style/TrailingCommaInArguments:
7260
Description: Prefer always trailing comma on multiline argument lists. This makes
7361
diffs, and re-ordering nicer.
7462
EnforcedStyleForMultiline: comma
75-
Style/TrailingCommaInLiteral:
76-
Description: Prefer always trailing comma on multiline literals. This makes diffs,
77-
and re-ordering nicer.
78-
EnforcedStyleForMultiline: comma
7963
Style/SymbolArray:
8064
Description: Using percent style obscures symbolic intent of array's contents.
8165
EnforcedStyle: brackets
66+
RSpec/ImplicitSubject:
67+
Enabled: false
68+
Lint/BooleanSymbol:
69+
Enabled: false
70+
Naming/MethodParameterName:
71+
AllowedNames:
72+
- is
8273
RSpec/MessageSpies:
8374
EnforcedStyle: receive
8475
Style/Documentation:
@@ -93,15 +84,9 @@ Style/MethodCalledOnDoEndBlock:
9384
Enabled: true
9485
Style/StringMethods:
9586
Enabled: true
96-
GetText/DecorateFunctionMessage:
97-
Enabled: false
98-
GetText/DecorateStringFormattingUsingInterpolation:
99-
Enabled: false
100-
GetText/DecorateStringFormattingUsingPercent:
101-
Enabled: false
10287
Layout/EndOfLine:
10388
Enabled: false
104-
Layout/IndentHeredoc:
89+
Layout/HeredocIndentation:
10590
Enabled: false
10691
Metrics/AbcSize:
10792
Enabled: false

.sync.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
delete: true
1212
appveyor.yml:
1313
delete: true
14-
spec/acceptance/nodesets/debian-8.yml:
15-
delete: true
16-
spec/acceptance/nodesets/debian-9.yml:
14+
spec/acceptance/nodesets/el9.yml:
1715
delete: true
1816
spec/acceptance/nodesets/debian-10.yml:
1917
delete: true
20-
spec/acceptance/nodesets/ubuntu-1804.yml:
18+
spec/acceptance/nodesets/debian-11.yml:
2119
delete: true
2220
spec/acceptance/nodesets/ubuntu-2004.yml:
2321
delete: true
22+
spec/acceptance/nodesets/ubuntu-2204.yml:
23+
delete: true

Gemfile

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,22 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
1717
minor_version = ruby_version_segments[0..1].join('.')
1818

1919
group :development do
20-
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
21-
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
22-
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
23-
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
24-
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
25-
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))
26-
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
27-
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
28-
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
29-
gem "puppet-module-win-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
30-
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
31-
gem "puppet-lint-param-docs", require: false
32-
gem "github_changelog_generator", require: false
20+
gem "voxpupuli-test", '7.0.0', require: false
21+
gem "faraday", '~> 1.0', require: false
22+
gem "github_changelog_generator", require: false
23+
gem "puppet-blacksmith", require: false
24+
gem "puppet-strings", require: false
3325
end
3426
group :system_tests do
35-
gem "puppet-module-posix-system-r#{minor_version}", '~> 0.5', require: false, platforms: [:ruby]
36-
gem "puppet-module-win-system-r#{minor_version}", '~> 0.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
37-
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.0')
27+
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.29')
3828
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
3929
gem "beaker-pe", require: false
4030
gem "beaker-hostgenerator"
4131
gem "beaker-rspec"
42-
gem "beaker-docker", *location_for(ENV['BEAKER_DOCKER_VERSION'] || '~> 0.7.0')
32+
gem "beaker-docker"
4333
gem "beaker-puppet"
34+
gem "beaker-puppet_install_helper", require: false
35+
gem "beaker-module_install_helper", require: false
4436
end
4537

4638
puppet_version = ENV['PUPPET_GEM_VERSION']

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# frozen_string_literal: true
22

3-
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
43
require 'puppetlabs_spec_helper/rake_tasks'
54
require 'puppet-syntax/tasks/puppet-syntax'
5+
require 'beaker-rspec/rake_task' if Bundler.rubygems.find_name('beaker-rspec').any?
66
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
77
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
88
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?

lib/facter/crashkernel.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Fact: crashkernel
24
#
35
# Purpose:
@@ -15,10 +17,8 @@
1517
setcode do
1618
crashkernel = false
1719
kernel_arguments = Facter.value(:kdump_kernel_arguments)
18-
if kernel_arguments
19-
if kernel_arguments =~ %r{crashkernel=(\S+)}
20-
crashkernel = Regexp.last_match(1)
21-
end
20+
if kernel_arguments && (kernel_arguments =~ %r{crashkernel=(\S+)})
21+
crashkernel = Regexp.last_match(1)
2222
end
2323
crashkernel
2424
end

lib/facter/kdump_kernel_arguments.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Fact: kdump_kernel_arguments
24
#
35
# Purpose:

manifests/init.pp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
Boolean $manage_kernel_parameter = true,
5858
Optional[String] $grub_kdump_cfg = undef,
5959
) {
60-
6160
$osfamily = dig($facts, 'os', 'family')
6261
if ! ($osfamily in ['RedHat', 'Debian']) {
6362
fail("Unsupported osfamily: ${osfamily}, module ${module_name} only support RedHat and Debian")
@@ -128,13 +127,13 @@
128127
}
129128

130129
package { 'kexec-tools':
131-
ensure => present,
130+
ensure => 'installed',
132131
name => $package_name,
133132
before => File['/etc/kdump.conf'],
134133
}
135134

136135
file { '/etc/kdump.conf':
137-
ensure => present,
136+
ensure => 'file',
138137
path => $config_path,
139138
content => template('kdump/kdump.conf.erb'),
140139
owner => 'root',
@@ -145,7 +144,7 @@
145144

146145
if ! $facts['crashkernel'] {
147146
notify { 'kdump':
148-
message => 'A reboot is required to fully enable the crashkernel'
147+
message => 'A reboot is required to fully enable the crashkernel',
149148
}
150149
}
151150
} else {
@@ -168,7 +167,7 @@
168167

169168
if $facts['crashkernel'] {
170169
notify { 'kdump':
171-
message => 'A reboot is required to fully disable the crashkernel'
170+
message => 'A reboot is required to fully disable the crashkernel',
172171
}
173172
}
174173
}
@@ -180,5 +179,4 @@
180179
hasstatus => $service_hasstatus,
181180
hasrestart => $service_hasrestart,
182181
}
183-
184182
}

metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@
5353
"requirements": [
5454
{
5555
"name": "puppet",
56-
"version_requirement": ">= 6.0.0 < 8.0.0"
56+
"version_requirement": ">= 7.0.0 < 9.0.0"
5757
}
5858
],
5959
"tags": [
6060
"kdump"
6161
],
62-
"pdk-version": "2.1.0",
62+
"pdk-version": "2.7.1",
6363
"template-url": "https://github.com/treydock/pdk-templates#master",
64-
"template-ref": "heads/master-0-g3b13f94"
64+
"template-ref": "heads/master-0-g76f4dbb"
6565
}

0 commit comments

Comments
 (0)