Skip to content

Commit 74d3c54

Browse files
authored
Merge pull request #2600 from puppetlabs/CAT-2360
(CAT-2360) Prepare module for Puppetcore / Drop Support for Puppet 7
2 parents 1b27ead + 149e796 commit 74d3c54

21 files changed

+67
-102
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ jobs:
1818
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
1919
with:
2020
runs_on: "ubuntu-24.04"
21+
flags: "--nightly --platform-exclude centos-7 --platform-exclude oraclelinux-7 --platform-exclude scientific-7"
2122
secrets: "inherit"

.github/workflows/nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ jobs:
1717
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
1818
with:
1919
runs_on: "ubuntu-24.04"
20+
flags: "--nightly --platform-exclude centos-7 --platform-exclude oraclelinux-7 --platform-exclude scientific-7"
2021
secrets: "inherit"
2122

.puppet-lint.rc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
--fail-on-warnings
12
--relative
2-
--no-anchor_resource-check
3+
--no-80chars-check
34
--no-140chars-check
5+
--no-class_inherits_from_params_class-check
6+
--no-autoloader_layout-check
7+
--no-documentation-check
8+
--no-single_quote_string_with_variables-check
9+
--no-anchor_resource-check
10+
--ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require:
55
AllCops:
66
NewCops: enable
77
DisplayCopNames: true
8-
TargetRubyVersion: '2.6'
8+
TargetRubyVersion: '3.1'
99
Include:
1010
- "**/*.rb"
1111
Exclude:

.rubocop_todo.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2023-11-28 08:35:58 UTC using RuboCop version 1.48.1.
3+
# on 2025-07-08 13:54:59 UTC using RuboCop version 1.50.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -23,7 +23,7 @@ RSpec/FilePath:
2323
- 'spec/classes/mod/lookup_identity.rb'
2424
- 'spec/classes/mod/proxy_wstunnel.rb'
2525

26-
# Offense count: 290
26+
# Offense count: 306
2727
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
2828
# SupportedStyles: always, named_only
2929
RSpec/NamedSubject:

Gemfile

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,50 +14,55 @@ def location_for(place_or_version, fake_version = nil)
1414
end
1515

1616
group :development do
17-
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))
18-
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
19-
gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2017
gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2118
gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2219
gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2320
gem "deep_merge", '~> 1.2.2', require: false
2421
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
25-
gem "facterdb", '~> 1.18', require: false
22+
gem "facterdb", '~> 2.1', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
23+
gem "facterdb", '~> 3.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2624
gem "metadata-json-lint", '~> 4.0', require: false
27-
gem "rspec-puppet-facts", '~> 2.0', require: false
25+
gem "json-schema", '< 5.1.1', require: false
26+
gem "rspec-puppet-facts", '~> 4.0', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
27+
gem "rspec-puppet-facts", '~> 5.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2828
gem "dependency_checker", '~> 1.0.0', require: false
2929
gem "parallel_tests", '= 3.12.1', require: false
3030
gem "pry", '~> 0.10', require: false
3131
gem "simplecov-console", '~> 0.9', require: false
32-
gem "puppet-debugger", '~> 1.0', require: false
32+
gem "puppet-debugger", '~> 1.6', require: false
3333
gem "rubocop", '~> 1.50.0', require: false
3434
gem "rubocop-performance", '= 1.16.0', require: false
3535
gem "rubocop-rspec", '= 2.19.0', require: false
3636
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
37-
gem "rexml", '>= 3.3.9', require: false
37+
gem "bigdecimal", '< 3.2.2', require: false, platforms: [:mswin, :mingw, :x64_mingw]
3838
end
3939
group :development, :release_prep do
4040
gem "puppet-strings", '~> 4.0', require: false
41-
gem "puppetlabs_spec_helper", '~> 7.0', require: false
41+
gem "puppetlabs_spec_helper", '~> 8.0', require: false
42+
gem "puppet-blacksmith", '~> 7.0', require: false
4243
end
4344
group :system_tests do
44-
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
45+
gem "puppet_litmus", '~> 2.0', require: false, platforms: [:ruby, :x64_mingw] if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty?
46+
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] if ENV['PUPPET_FORGE_TOKEN'].to_s.empty?
4547
gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw]
4648
gem "serverspec", '~> 2.41', require: false
4749
end
4850

49-
puppet_version = ENV['PUPPET_GEM_VERSION']
50-
facter_version = ENV['FACTER_GEM_VERSION']
51-
hiera_version = ENV['HIERA_GEM_VERSION']
52-
5351
gems = {}
52+
puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil)
53+
facter_version = ENV.fetch('FACTER_GEM_VERSION', nil)
54+
hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil)
5455

55-
gems['puppet'] = location_for(puppet_version)
56-
57-
# If facter or hiera versions have been specified via the environment
58-
# variables
56+
# If PUPPET_FORGE_TOKEN is set then use authenticated source for both puppet and facter, since facter is a transitive dependency of puppet
57+
# Otherwise, do as before and use location_for to fetch gems from the default source
58+
if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty?
59+
gems['puppet'] = ['~> 8.11', { require: false, source: 'https://rubygems-puppetcore.puppet.com' }]
60+
gems['facter'] = ['~> 4.11', { require: false, source: 'https://rubygems-puppetcore.puppet.com' }]
61+
else
62+
gems['puppet'] = location_for(puppet_version)
63+
gems['facter'] = location_for(facter_version) if facter_version
64+
end
5965

60-
gems['facter'] = location_for(facter_version) if facter_version
6166
gems['hiera'] = location_for(hiera_version) if hiera_version
6267

6368
gems.each do |gem_name, gem_params|

Rakefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,14 @@ require 'puppet-syntax/tasks/puppet-syntax'
77
require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
88

99
PuppetLint.configuration.send('disable_relative')
10+
PuppetLint.configuration.send('disable_80chars')
11+
PuppetLint.configuration.send('disable_140chars')
12+
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
13+
PuppetLint.configuration.send('disable_autoloader_layout')
14+
PuppetLint.configuration.send('disable_documentation')
15+
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
1016
PuppetLint.configuration.send('disable_anchor_resource')
1117
PuppetLint.configuration.send('disable_140chars')
18+
PuppetLint.configuration.fail_on_warnings = true
19+
PuppetLint.configuration.ignore_paths = [".vendor/**/*.pp", ".bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp", "tests/**/*.pp", "types/**/*.pp", "vendor/**/*.pp"]
20+

metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@
8484
"requirements": [
8585
{
8686
"name": "puppet",
87-
"version_requirement": ">= 7.9.0 < 9.0.0"
87+
"version_requirement": ">= 8.0.0 < 9.0.0"
8888
}
8989
],
9090
"description": "Module for Apache configuration",
91-
"pdk-version": "3.2.0",
91+
"pdk-version": "3.5.0 (ga43db72)",
9292
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
93-
"template-ref": "tags/3.2.0.4-0-g5d17ec1"
93+
"template-ref": "heads/main-0-ga1e4056"
9494
}

spec/acceptance/mod_php_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ class { 'apache::mod::php': }
2626
end
2727

2828
if os[:family] == 'debian' && os[:release] =~ %r{^9\.}
29+
2930
describe file("#{apache_hash['mod_dir']}/php7.0.conf") do
3031
it { is_expected.to contain 'DirectoryIndex index.php' }
3132
end
32-
elsif os[:family] == 'debian' && os[:release] =~ %r{^10\.}
33+
elsif os[:family] == 'debian' && os[:release] =~ %r{^10}
3334
describe file("#{apache_hash['mod_dir']}/php7.3.conf") do
3435
it { is_expected.to contain 'DirectoryIndex index.php' }
3536
end
36-
elsif os[:family] == 'debian' && os[:release] =~ %r{^11\.}
37+
elsif os[:family] == 'debian' && os[:release] =~ %r{^11}
3738
describe file("#{apache_hash['mod_dir']}/php7.4.conf") do
3839
it { is_expected.to contain 'DirectoryIndex index.php' }
3940
end

spec/classes/mod/alias_spec.rb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
it { is_expected.to contain_file('alias.conf').with(content: %r{Alias /icons/ "/usr/share/apache2/icons/"}) }
1414
end
1515

16-
context 'on a RedHat 7-based OS', :compile do
17-
include_examples 'RedHat 7'
18-
19-
it { is_expected.to contain_apache__mod('alias') }
20-
it { is_expected.to contain_file('alias.conf').with(content: %r{Alias /icons/ "/usr/share/httpd/icons/"}) }
21-
end
22-
2316
context 'on a RedHat 8-based OS', :compile do
2417
include_examples 'RedHat 8'
2518

@@ -37,7 +30,7 @@
3730
}
3831
end
3932

40-
include_examples 'RedHat 7'
33+
include_examples 'RedHat 8'
4134

4235
it { is_expected.to contain_apache__mod('alias') }
4336
it { is_expected.to contain_file('alias.conf').with(content: %r{Options foo}) }
@@ -53,7 +46,7 @@
5346
}
5447
end
5548

56-
include_examples 'RedHat 7'
49+
include_examples 'RedHat 8'
5750

5851
it { is_expected.to contain_apache__mod('alias') }
5952
it { is_expected.to contain_file('alias.conf').with(content: %r{Alias /apache-icons/ "/usr/share/httpd/icons/"}) }
@@ -69,7 +62,7 @@
6962
}
7063
end
7164

72-
include_examples 'RedHat 7'
65+
include_examples 'RedHat 8'
7366

7467
it { is_expected.to contain_apache__mod('alias') }
7568
it { is_expected.not_to contain_file('alias.conf') }

0 commit comments

Comments
 (0)