Skip to content

Commit 8136601

Browse files
committed
(PA-5337) Update PE mappings for puppet8
This commit adds mappings for Puppet Enterprise 2023.3 to puppet8. Additionally, this removes mappings of PE to puppet-agent < 6, as they are not supported as standalone versions nor as versions from which to upgrade to a supported puppet-agent.
1 parent 3547b25 commit 8136601

File tree

2 files changed

+19
-29
lines changed

2 files changed

+19
-29
lines changed

manifests/params.pp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,18 @@
4848
if $_is_pe {
4949
# Calculate the default collection
5050
$_pe_version = pe_build_version()
51-
# Not PE or pe_version < 2018.1.3, use PC1
52-
if ($_pe_version == undef or versioncmp($_pe_version, '2018.1.3') < 0) {
53-
$collection = 'PC1'
54-
}
55-
# 2018.1.3 <= pe_version < 2018.2, use puppet5
56-
elsif versioncmp($_pe_version, '2018.2') < 0 {
57-
$collection = 'puppet5'
58-
}
59-
# 2018.2 <= pe_version < 2021.0 use puppet6
60-
elsif versioncmp($_pe_version, '2021.0') < 0 {
51+
# pe_version < 2021.0 use puppet6
52+
if versioncmp($_pe_version, '2021.0') < 0 {
6153
$collection = 'puppet6'
6254
}
6355
# pe_version >= 2021.0, use puppet7
64-
else {
56+
elsif versioncmp($_pe_version, '2023.3') < 0 {
6557
$collection = 'puppet7'
6658
}
59+
# pe_version >= 2023.3, use puppet8
60+
else {
61+
$collection = 'puppet8'
62+
}
6763
# The aio puppet-agent version currently installed on the compiling master
6864
# (only used in PE)
6965
if is_function_available('pe_compiling_server_aio_build') {

spec/classes/puppet_agent_params_spec.rb

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,6 @@ def sets_collection_to(collection)
4040
is_expected.to contain_notify(notify_title).with_message(collection)
4141
end
4242

43-
context 'pe_version < 2018.1.3' do
44-
let(:facts) { super().merge(custom_fact__pe_version: '2018.1.2') }
45-
46-
it { sets_collection_to('PC1') }
47-
end
48-
49-
context 'pe_version == 2018.1.3' do
50-
let(:facts) { super().merge(custom_fact__pe_version: '2018.1.3') }
51-
52-
it { sets_collection_to('puppet5') }
53-
end
54-
55-
context '2018.1.3 < pe_version < 2018.2' do
56-
let(:facts) { super().merge(custom_fact__pe_version: '2018.1.5') }
57-
58-
it { sets_collection_to('puppet5') }
59-
end
60-
6143
context 'pe_version == 2018.2' do
6244
let(:facts) { super().merge(custom_fact__pe_version: '2018.2') }
6345

@@ -81,5 +63,17 @@ def sets_collection_to(collection)
8163

8264
it { sets_collection_to('puppet7') }
8365
end
66+
67+
context '2023.3 > pe_version >= 2023.0' do
68+
let(:facts) { super().merge(custom_fact__pe_version: '2023.0') }
69+
70+
it { sets_collection_to('puppet7') }
71+
end
72+
73+
context 'pe_version >= 2023.3' do
74+
let(:facts) { super().merge(custom_fact__pe_version: '2023.3') }
75+
76+
it { sets_collection_to('puppet8') }
77+
end
8478
end
8579
end

0 commit comments

Comments
 (0)