From e2d1628e950c5fc636448401370b8d56ea52927a Mon Sep 17 00:00:00 2001 From: Daniel Mayer Date: Fri, 9 Jan 2026 18:01:14 +0100 Subject: [PATCH 1/4] feat: add sql server 2025 support This adds support for SQL Server 2025. --- README.md | 1 + documentation/sql_server_configure.md | 2 +- libraries/helper.rb | 5 +++++ resources/install.rb | 9 ++++++++- templates/ConfigurationFile.ini.erb | 6 +++--- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2dd0821..18a2c42 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ together to maintain important cookbooks. If you’d like to know more please vi - Microsoft SQL Server 2017 - Microsoft SQL Server 2019 - Microsoft SQL Server 2022 +- Microsoft SQL Server 2025 ### Supported Client Versions diff --git a/documentation/sql_server_configure.md b/documentation/sql_server_configure.md index f827287..266280a 100644 --- a/documentation/sql_server_configure.md +++ b/documentation/sql_server_configure.md @@ -6,7 +6,7 @@ ## Properties -- `version` - SQL Version of the instance to be configured. Valid options are `2012`, `2016`, `2017`, `2019`, `2022`. Default is `2012` +- `version` - SQL Version of the instance to be configured. Valid options are `2012`, `2016`, `2017`, `2019`, `2022`, `2025`. Default is `2012` - `tcp_enabled` - If TCP is enabled for the instance. Default is true - `sql_port` - Port SQL will listen on. Default is 1433 - `tcp_dynamic_ports` - Sets the Dynamic port SQL will listen on. Default is an empty string diff --git a/libraries/helper.rb b/libraries/helper.rb index 4d71544..08fb8ea 100644 --- a/libraries/helper.rb +++ b/libraries/helper.rb @@ -31,6 +31,7 @@ def self.reg_version_string(version) when '2017' then 'MSSQL14.' when '2019' then 'MSSQL15.' when '2022' then 'MSSQL16.' + when '2025' then 'MSSQL17.' else raise "Unsupported sql_server version '#{version}'. Please open a PR to add support for this version." end end @@ -42,6 +43,7 @@ def self.install_dir_version(version) when '2017' then '140' when '2019' then '150' when '2022' then '160' + when '2025' then '170' else raise "SQL Server version #{version} not supported. Please open a PR to add support for this version." end end @@ -59,6 +61,7 @@ def self.sql_server_url(version, x86_64) when '2017' then 'https://download.microsoft.com/download/E/F/2/EF23C21D-7860-4F05-88CE-39AA114B014B/SQLEXPR_x64_ENU.exe' when '2019' then 'https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SQLEXPR_x64_ENU.exe' when '2022' then 'https://download.microsoft.com/download/5/1/4/5145fe04-4d30-4b85-b0d1-39533663a2f1/SQL2022-SSEI-Expr.exe' + when '2025' then 'https://download.microsoft.com/download/7ab8f535-7eb8-4b16-82eb-eca0fa2d38f3/SQL2025-SSEI-Expr.exe' end else case version.to_s @@ -75,6 +78,7 @@ def self.sql_server_package_name(version, x86_64) when '2017' then 'Microsoft SQL Server 2017 (64-bit)' when '2019' then 'Microsoft SQL Server 2019 (64-bit)' when '2022' then 'Microsoft SQL Server 2022 (64-bit)' + when '2025' then 'Microsoft SQL Server 2025 (64-bit)' end else case version.to_s @@ -91,6 +95,7 @@ def self.sql_server_checksum(version, x86_64) when '2017' then 'F857FF82145E196BF85AF32EEB0193FE38302E57B30BEB54E513630C60D83E0D' when '2019' then 'bea033e778048748eb1c87bf57597f7f5449b6a15bac55ddc08263c57f7a1ca8' when '2022' then '36e0ec2ac3dd60f496c99ce44722c629209ea7302a2ce9cbfd1e42a73510d7b6' + when '2025' then '1c677a33b318481c3217128835f8405cf0026621dcd04b13eb6cb0982e823f27' end else case version.to_s diff --git a/resources/install.rb b/resources/install.rb index b7ef280..1b9d8de 100644 --- a/resources/install.rb +++ b/resources/install.rb @@ -177,12 +177,19 @@ "/#{option}=\"#{safe_password}#{enclosing_escape}\"" end.compact.join ' ' + # The SQL Server 2025 setup requires /IAcceptSQLServerLicenseTerms to be passed as a parameter not as a ini entry + accept_license_option = if new_resource.accept_eula && new_resource.version.to_s() == '2025' + '/IAcceptSQLServerLicenseTerms' + else + '' + end + package install_name do source package_url checksum install_checksum timeout new_resource.installer_timeout installer_type :custom - options "/q /ConfigurationFile=#{config_file_path} #{passwords_options}" + options "/q #{accept_license_option} /ConfigurationFile=#{config_file_path} #{passwords_options}" action :install notifies :reboot_now, 'reboot[sql server install]' if new_resource.sql_reboot returns [0, 42, 127, 3010] diff --git a/templates/ConfigurationFile.ini.erb b/templates/ConfigurationFile.ini.erb index b03b769..4bfb0b2 100644 --- a/templates/ConfigurationFile.ini.erb +++ b/templates/ConfigurationFile.ini.erb @@ -58,11 +58,11 @@ QUIET="False" QUIETSIMPLE="False" -<% if @version != '2022' %> +<% unless %w(2022 2025).include?(@version.to_s()) %> ; Specifies that Setup should install into WOW64. This command line argument is not supported on an IA64 or a 32-bit system. X86="False" -<% end%> +<% end %> ; Detailed help for command line argument ROLE has not been defined yet. @@ -330,7 +330,7 @@ EXTSVCACCOUNT="NT Service\MSSQLLaunchpad" <% end %> <% end %> -<% if %w(2016 2017 2019 2022).include? @version %> +<% if %w(2016 2017 2019 2022 2025).include? @version %> ; Enables instant file initialization for SQL Server service account. SQLSVCINSTANTFILEINIT="<%= @sql_instant_file_init ? "True" : "False" %>" From 82162e86136eb6865303ad9bacd7de4272e9a567 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Tue, 13 Jan 2026 18:40:48 +0000 Subject: [PATCH 2/4] Update resources/install.rb Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- resources/install.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/install.rb b/resources/install.rb index 1b9d8de..6f60146 100644 --- a/resources/install.rb +++ b/resources/install.rb @@ -178,7 +178,7 @@ end.compact.join ' ' # The SQL Server 2025 setup requires /IAcceptSQLServerLicenseTerms to be passed as a parameter not as a ini entry - accept_license_option = if new_resource.accept_eula && new_resource.version.to_s() == '2025' + accept_license_option = if new_resource.accept_eula && new_resource.version.to_s == '2025' '/IAcceptSQLServerLicenseTerms' else '' From ca90e728f90a53822bb6ba90b94d0cb2de6f5bc9 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Tue, 13 Jan 2026 18:41:36 +0000 Subject: [PATCH 3/4] Update templates/ConfigurationFile.ini.erb Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- templates/ConfigurationFile.ini.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/ConfigurationFile.ini.erb b/templates/ConfigurationFile.ini.erb index 4bfb0b2..f54bb51 100644 --- a/templates/ConfigurationFile.ini.erb +++ b/templates/ConfigurationFile.ini.erb @@ -58,7 +58,7 @@ QUIET="False" QUIETSIMPLE="False" -<% unless %w(2022 2025).include?(@version.to_s()) %> +<% unless %w(2022 2025).include?(@version.to_s) %> ; Specifies that Setup should install into WOW64. This command line argument is not supported on an IA64 or a 32-bit system. X86="False" From afe1903a743485e89733987f27640e5c8fa7ca1f Mon Sep 17 00:00:00 2001 From: Daniel Mayer Date: Tue, 13 Jan 2026 23:47:16 +0100 Subject: [PATCH 4/4] refactor installer options handling --- resources/install.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/resources/install.rb b/resources/install.rb index 6f60146..ed6e27d 100644 --- a/resources/install.rb +++ b/resources/install.rb @@ -162,6 +162,8 @@ ::SqlServer::Helper.sql_server_checksum(new_resource.version, x86_64) || ::Chef::Application.fatal!("No package checksum matches '#{new_resource.version}'. package_checksum property must be set or version property must match a supported version.") + install_options = ['/q', "/ConfigurationFile=#{config_file_path}"] + # Build safe password command line options for the installer # see http://technet.microsoft.com/library/ms144259 passwords_options = { @@ -175,21 +177,21 @@ # When the number of double quotes is odd, we need to escape the enclosing quotes enclosing_escape = safe_password.count('"').odd? ? '^' : '' "/#{option}=\"#{safe_password}#{enclosing_escape}\"" - end.compact.join ' ' + end.compact + + install_options.push(passwords_options) # The SQL Server 2025 setup requires /IAcceptSQLServerLicenseTerms to be passed as a parameter not as a ini entry - accept_license_option = if new_resource.accept_eula && new_resource.version.to_s == '2025' - '/IAcceptSQLServerLicenseTerms' - else - '' - end + if new_resource.accept_eula && new_resource.version.to_s == '2025' + install_options.push('/IAcceptSQLServerLicenseTerms') + end package install_name do source package_url checksum install_checksum timeout new_resource.installer_timeout installer_type :custom - options "/q #{accept_license_option} /ConfigurationFile=#{config_file_path} #{passwords_options}" + options install_options.join(' ') action :install notifies :reboot_now, 'reboot[sql server install]' if new_resource.sql_reboot returns [0, 42, 127, 3010]