Skip to content

Commit d798735

Browse files
committed
(MODULES-11615) Add support for SQL Server 2025
1 parent ec78e2d commit d798735

7 files changed

Lines changed: 44 additions & 25 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
## Overview
2323

24-
The sqlserver module installs and manages Microsoft SQL Server 2014, 2016, 2017, 2019 and 2022 on Windows systems.
24+
The sqlserver module installs and manages Microsoft SQL Server 2014, 2016, 2017, 2019, 2022 and 2025 on Windows systems.
2525

2626
## Module Description
2727

@@ -273,11 +273,11 @@ For information on the classes and types, see the [REFERENCE.md](https://github.
273273

274274
## Limitations
275275

276-
SQL 2017, 2019 and 2022 detection support has been added. This support is limited to functionality already present for other versions.
276+
SQL 2017, 2019, 2022 and 2025 detection support has been added. This support is limited to functionality already present for other versions.
277277

278278
The MSOLEDBSQL driver is now required to use this module. You can use this chocolatey [package](https://community.chocolatey.org/packages/msoledbsql) for installation. but it must version 18.x or earlier. (v19+ is not currently supported)
279279

280-
This module can manage only a single version of SQL Server on a given host (one and only one of SQL Server 2014, 2016, 2017, 2019 or 2022). The module is able to manage multiple SQL Server instances of the same version.
280+
This module can manage only a single version of SQL Server on a given host (one and only one of SQL Server 2014, 2016, 2017, 2019, 2022 or 2025). The module is able to manage multiple SQL Server instances of the same version.
281281

282282
This module cannot manage the SQL Server Native Client SDK (also known as SNAC_SDK). The SQL Server installation media can install the SDK, but it is not able to uninstall the SDK. Note that the 'sqlserver_features' fact detects the presence of the SDK.
283283

lib/puppet_x/sqlserver/features.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
SQL_2017 = 'SQL_2017'
88
SQL_2019 = 'SQL_2019'
99
SQL_2022 = 'SQL_2022'
10+
SQL_2025 = 'SQL_2025'
1011

11-
ALL_SQL_VERSIONS = [SQL_2014, SQL_2016, SQL_2017, SQL_2019, SQL_2022].freeze
12+
ALL_SQL_VERSIONS = [SQL_2014, SQL_2016, SQL_2017, SQL_2019, SQL_2022, SQL_2025].freeze
1213

1314
# rubocop:disable Style/ClassAndModuleChildren
1415
module PuppetX
@@ -35,12 +36,15 @@ class Features # rubocop:disable Style/Documentation
3536
major_version: 15,
3637
registry_path: '150'
3738
},
38-
SQL_2022 => {
39-
major_version: 16,
40-
registry_path: '160'
41-
}
39+
SQL_2022 => {
40+
major_version: 16,
41+
registry_path: '160'
42+
},
43+
SQL_2025 => {
44+
major_version: 17,
45+
registry_path: '170'
46+
}
4247
}.freeze
43-
4448
SQL_REG_ROOT = 'Software\Microsoft\Microsoft SQL Server'
4549
HKLM = 'HKEY_LOCAL_MACHINE'
4650

lib/puppet_x/sqlserver/server_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def self.sql_version_from_install_source(source_dir)
4343
ver = content.match('"(.+)"')
4444
return nil if ver.nil?
4545

46+
return SQL_2025 if ver[1].start_with?('17.')
4647
return SQL_2022 if ver[1].start_with?('16.')
4748
return SQL_2019 if ver[1].start_with?('15.')
4849
return SQL_2017 if ver[1].start_with?('14.')

metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "puppetlabs-sqlserver",
33
"version": "5.0.5",
44
"author": "puppetlabs",
5-
"summary": "The `sqlserver` module installs and manages MS SQL Server 2014, 2016, 2017, 2019 and 2022 on Windows systems.",
5+
"summary": "The `sqlserver` module installs and manages MS SQL Server 2014, 2016, 2017, 2019, 2022 and 2025 on Windows systems.",
66
"license": "proprietary",
77
"source": "https://github.com/puppetlabs/puppetlabs-sqlserver",
88
"project_page": "https://github.com/puppetlabs/puppetlabs-sqlserver",
@@ -45,6 +45,7 @@
4545
"sql2017",
4646
"sql2019",
4747
"sql2022",
48+
"sql2025",
4849
"tsql",
4950
"database"
5051
],

spec/acceptance/z_last_sqlserver_features_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def bind_and_apply_failing_manifest(features, ensure_val = 'present')
5353
end
5454

5555
context 'can install' do
56-
# Client Tools removed in Server2022 (Backwards Compatibility, Connectivity, SDK)
57-
features = if version.to_i == 2022
56+
# Client Tools removed in Server2022+ (Backwards Compatibility, Connectivity, SDK)
57+
features = if version.to_i >= 2022
5858
['IS', 'MDS', 'DQC']
5959
elsif version.to_i >= 2016 && version.to_i < 2022
6060
['BC', 'Conn', 'SDK', 'IS', 'MDS', 'DQC']
@@ -70,8 +70,8 @@ def bind_and_apply_failing_manifest(features, ensure_val = 'present')
7070
ensure_sql_features(features)
7171

7272
validate_sql_install(version:) do |r|
73-
# Client Tools removed in Server2022
74-
unless version.to_i == 2022
73+
# Client Tools removed in Server2022+
74+
unless version.to_i >= 2022
7575
expect(r.stdout).to match(%r{Client Tools Connectivity})
7676
expect(r.stdout).to match(%r{Client Tools Backwards Compatibility})
7777
expect(r.stdout).to match(%r{Client Tools SDK})
@@ -83,7 +83,7 @@ def bind_and_apply_failing_manifest(features, ensure_val = 'present')
8383
end
8484

8585
context 'can remove' do
86-
features = if version.to_i == 2022
86+
features = if version.to_i >= 2022
8787
['IS', 'MDS', 'DQC']
8888
elsif version.to_i >= 2016 && version.to_i < 2022
8989
['BC', 'Conn', 'SDK', 'IS', 'MDS', 'DQC']
@@ -95,8 +95,8 @@ def bind_and_apply_failing_manifest(features, ensure_val = 'present')
9595
ensure_sql_features(features, 'absent')
9696

9797
validate_sql_install(version:) do |r|
98-
# Client Tools removed in Server2022
99-
unless version.to_i == 2022
98+
# Client Tools removed in Server2022+
99+
unless version.to_i >= 2022
100100
expect(r.stdout).not_to match(%r{Client Tools Connectivity})
101101
expect(r.stdout).not_to match(%r{Client Tools Backwards Compatibility})
102102
expect(r.stdout).not_to match(%r{Client Tools SDK})
@@ -108,7 +108,7 @@ def bind_and_apply_failing_manifest(features, ensure_val = 'present')
108108
end
109109

110110
context 'can remove independent feature' do
111-
features = if version.to_i == 2022
111+
features = if version.to_i >= 2022
112112
['IS', 'MDS', 'DQC']
113113
elsif version.to_i >= 2016 && version.to_i < 2022
114114
['BC', 'Conn', 'SDK', 'IS', 'MDS', 'DQC']
@@ -124,7 +124,7 @@ def bind_and_apply_failing_manifest(features, ensure_val = 'present')
124124
ensure_sql_features(features, 'absent')
125125
end
126126

127-
it "'BC'", unless: version.to_i == 2022 do
127+
it "'BC'", unless: version.to_i >= 2022 do
128128
ensure_sql_features(features - ['BC'])
129129

130130
validate_sql_install(version:) do |r|
@@ -143,7 +143,7 @@ def bind_and_apply_failing_manifest(features, ensure_val = 'present')
143143
end
144144
end
145145

146-
it "'SDK' + 'IS", unless: version.to_i == 2022 do
146+
it "'SDK' + 'IS", unless: version.to_i >= 2022 do
147147
ensure_sql_features(features - ['SDK', 'IS'])
148148

149149
validate_sql_install(version:) do |r|
@@ -168,7 +168,7 @@ def bind_and_apply_failing_manifest(features, ensure_val = 'present')
168168
context 'with no installed instances' do
169169
# Currently this test can only be run on a machine once and will error if run a second time
170170
context 'can install' do
171-
features = if version.to_i == 2022
171+
features = if version.to_i >= 2022
172172
['IS', 'MDS', 'DQC']
173173
elsif version.to_i >= 2016 && version.to_i < 2022
174174
['BC', 'Conn', 'SDK', 'IS', 'MDS', 'DQC']

spec/spec_helper_acceptance_local.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class Helper
1111
WIN_ISO_ROOT = 'https://artifactory.delivery.puppetlabs.net/artifactory/generic__iso/iso/windows'
1212
WIN_2019_ISO = 'en_windows_server_2019_updated_july_2020_x64_dvd_94453821.iso'
1313
QA_RESOURCE_ROOT = 'https://artifactory.delivery.puppetlabs.net/artifactory/generic__iso/iso/SQLServer'
14+
SQL_2025_ISO = 'SQLServer2025-x64-ENU-Dev.iso'
1415
SQL_2022_ISO = 'SQLServer2022-x64-ENU-Dev.iso'
1516
SQL_2019_ISO = 'SQLServer2019CTP2.4-x64-ENU.iso'
1617
SQL_2017_ISO = 'SQLServer2017-x64-ENU.iso'
@@ -130,6 +131,12 @@ def base_install(sql_version)
130131
file: SQL_2022_ISO,
131132
drive_letter: 'H'
132133
}
134+
when 2025
135+
iso_opts = {
136+
folder: QA_RESOURCE_ROOT,
137+
file: SQL_2025_ISO,
138+
drive_letter: 'H'
139+
}
133140
end
134141
# Mount the ISO on the agent
135142
mount_iso(iso_opts)
@@ -230,13 +237,13 @@ def validate_sql_install(opts = {}, &block)
230237
end
231238

232239
def get_install_paths(version)
233-
vers = { '2014' => '120', '2016' => '130', '2017' => '140', '2019' => '150', '2022' => '160' }
240+
vers = { '2014' => '120', '2016' => '130', '2017' => '140', '2019' => '150', '2022' => '160', '2025' => '170' }
234241

235242
raise _('Valid version must be specified') unless vers.key?(version)
236243

237244
dir = "C://Program Files/Microsoft SQL Server/#{vers[version]}/Setup Bootstrap"
238245
sql_directory = case version
239-
when '2022', '2017'
246+
when '2025', '2022', '2017'
240247
"SQL#{version}"
241248
when '2019'
242249
"SQL#{version}CTP2.4"

spec/sql_testing_helpers.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ def base_install(sql_version)
120120
file: SQL_2022_ISO,
121121
drive_letter: 'H'
122122
}
123+
when 2025
124+
iso_opts = {
125+
folder: QA_RESOURCE_ROOT,
126+
file: SQL_2025_ISO,
127+
drive_letter: 'H'
128+
}
123129
end
124130
host = find_only_one('sql_host')
125131
# Mount the ISO on the agent
@@ -163,13 +169,13 @@ def remove_sql_instances(host, opts = {})
163169
end
164170

165171
def get_install_paths(version)
166-
vers = { '2014' => '120', '2016' => '130', '2017' => '140', '2019' => '150', '2022' => '160' }
172+
vers = { '2014' => '120', '2016' => '130', '2017' => '140', '2019' => '150', '2022' => '160', '2025' => '170' }
167173

168174
raise _('Valid version must be specified') unless vers.key?(version)
169175

170176
dir = "C://Program Files/Microsoft SQL Server/#{vers[version]}/Setup Bootstrap"
171177
sql_directory = case version
172-
when '2022', '2017'
178+
when '2025', '2022', '2017'
173179
"SQL#{version}"
174180
when '2019'
175181
"SQL#{version}CTP2.4"

0 commit comments

Comments
 (0)