Skip to content

Commit c4fb9a8

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

9 files changed

Lines changed: 92 additions & 37 deletions

File tree

.github/workflows/ci.yml

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

99
env:
10-
SERVICE_URL: https://facade-maint-config-windows-use-ssh-6f3kfepqcq-ew.a.run.app/v1/provision
10+
SERVICE_URL: https://facade-release-6f3kfepqcq-ew.a.run.app/v1/provision
1111
PUPPET_FORGE_TOKEN: ${{ secrets.PUPPET_FORGE_TOKEN || secrets.PUPPET_FORGE_TOKEN_PUBLIC }}
1212
BUNDLE_RUBYGEMS___PUPPETCORE__PUPPET__COM: "forge-key:${{ secrets.PUPPET_FORGE_TOKEN || secrets.PUPPET_FORGE_TOKEN_PUBLIC }}"
1313

@@ -72,6 +72,24 @@ jobs:
7272
with:
7373
service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }}
7474

75+
- name: Fix DNS
76+
run: |
77+
echo "=== Remove Azure DNS from eth0 interface ==="
78+
sudo resolvectl dns eth0 ""
79+
80+
echo "=== Configure Twingate DNS properly ==="
81+
sudo resolvectl dns sdwan0 100.95.0.251 100.95.0.252
82+
sudo resolvectl domain sdwan0 delivery.puppetlabs.net
83+
84+
echo "=== Flush DNS cache ==="
85+
sudo resolvectl flush-caches
86+
87+
echo "=== Check new configuration ==="
88+
resolvectl status
89+
90+
echo "=== Test DNS resolution ==="
91+
nslookup artifactory.delivery.puppetlabs.net
92+
7593
- name: Checkout
7694
uses: actions/checkout@v3
7795
with:
@@ -109,21 +127,21 @@ jobs:
109127
- name: Authenticate with GCP
110128
run: |
111129
echo '${{ secrets.GCP_CONNECTION }}' >> creds.json
112-
bundle exec bolt file upload creds.json C:\\creds.json --targets ssh_nodes --inventoryfile spec/fixtures/litmus_inventory.yaml
113-
bundle exec bolt command run "gcloud auth activate-service-account --key-file C:\\creds.json" --targets ssh_nodes --inventoryfile spec/fixtures/litmus_inventory.yaml
130+
bundle exec bolt file upload creds.json C:\\creds.json --targets all --inventoryfile spec/fixtures/litmus_inventory.yaml
131+
bundle exec bolt command run "gcloud auth activate-service-account --key-file C:\\creds.json" --targets all --inventoryfile spec/fixtures/litmus_inventory.yaml
114132
115133
- name: Download OS ISO
116134
run: |
117-
bundle exec bolt command run 'gsutil -q cp gs://artifactory-modules/windows/en_windows_server_2019_updated_july_2020_x64_dvd_94453821.iso C:\\' --targets ssh_nodes --inventoryfile spec/fixtures/litmus_inventory.yaml
135+
bundle exec bolt command run 'gsutil -q cp gs://artifactory-modules/windows/en_windows_server_2019_updated_july_2020_x64_dvd_94453821.iso C:\\' --targets all --inventoryfile spec/fixtures/litmus_inventory.yaml
118136
119137
- name: Download SQLServer ISO
120138
run: |
121-
bundle exec bolt command run 'gsutil -q cp gs://artifactory-modules/puppetlabs-sqlserver/SQLServer2019CTP2.4-x64-ENU.iso C:\\' --targets ssh_nodes --inventoryfile spec/fixtures/litmus_inventory.yaml
139+
bundle exec bolt command run 'gsutil -q cp gs://artifactory-modules/puppetlabs-sqlserver/SQLServer2019CTP2.4-x64-ENU.iso C:\\' --targets all --inventoryfile spec/fixtures/litmus_inventory.yaml
122140
123141
- name: Set Environment Variable
124142
run: |
125143
pass=`grep -oP '(?<=password: ).*' spec/fixtures/litmus_inventory.yaml`
126-
bundle exec bolt command run "[Environment]::SetEnvironmentVariable('pass', '$pass', 'Machine')" --targets ssh_nodes --inventoryfile spec/fixtures/litmus_inventory.yaml
144+
bundle exec bolt command run "[Environment]::SetEnvironmentVariable('pass', '$pass', 'Machine')" --targets all --inventoryfile spec/fixtures/litmus_inventory.yaml
127145
128146
- name: Run acceptance tests
129147
run: |

.github/workflows/nightly.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- cron: '0 0 * * *'
66

77
env:
8-
SERVICE_URL: https://facade-maint-config-windows-use-ssh-6f3kfepqcq-ew.a.run.app/v1/provision
8+
SERVICE_URL: https://facade-release-6f3kfepqcq-ew.a.run.app/v1/provision
99
PUPPET_FORGE_TOKEN: ${{ secrets.PUPPET_FORGE_TOKEN || secrets.PUPPET_FORGE_TOKEN_PUBLIC }}
1010
BUNDLE_RUBYGEMS___PUPPETCORE__PUPPET__COM: "forge-key:${{ secrets.PUPPET_FORGE_TOKEN || secrets.PUPPET_FORGE_TOKEN_PUBLIC }}"
1111

@@ -69,6 +69,24 @@ jobs:
6969
with:
7070
service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }}
7171

72+
- name: Fix DNS
73+
run: |
74+
echo "=== Remove Azure DNS from eth0 interface ==="
75+
sudo resolvectl dns eth0 ""
76+
77+
echo "=== Configure Twingate DNS properly ==="
78+
sudo resolvectl dns sdwan0 100.95.0.251 100.95.0.252
79+
sudo resolvectl domain sdwan0 delivery.puppetlabs.net
80+
81+
echo "=== Flush DNS cache ==="
82+
sudo resolvectl flush-caches
83+
84+
echo "=== Check new configuration ==="
85+
resolvectl status
86+
87+
echo "=== Test DNS resolution ==="
88+
nslookup artifactory.delivery.puppetlabs.net
89+
7290
- name: Checkout
7391
uses: actions/checkout@v3
7492
with:
@@ -106,21 +124,21 @@ jobs:
106124
- name: Authenitcate with GCP
107125
run: |
108126
echo '${{ secrets.GCP_CONNECTION }}' >> creds.json
109-
bundle exec bolt file upload creds.json C:\\creds.json --targets ssh_nodes --inventoryfile spec/fixtures/litmus_inventory.yaml
110-
bundle exec bolt command run "gcloud auth activate-service-account --key-file C:\\creds.json" --targets ssh_nodes --inventoryfile spec/fixtures/litmus_inventory.yaml
127+
bundle exec bolt file upload creds.json C:\\creds.json --targets all --inventoryfile spec/fixtures/litmus_inventory.yaml
128+
bundle exec bolt command run "gcloud auth activate-service-account --key-file C:\\creds.json" --targets all --inventoryfile spec/fixtures/litmus_inventory.yaml
111129
112130
- name: Download OS ISO
113131
run: |
114-
bundle exec bolt command run 'gsutil -q cp gs://artifactory-modules/windows/en_windows_server_2019_updated_july_2020_x64_dvd_94453821.iso C:\\' --targets ssh_nodes --inventoryfile spec/fixtures/litmus_inventory.yaml
132+
bundle exec bolt command run 'gsutil -q cp gs://artifactory-modules/windows/en_windows_server_2019_updated_july_2020_x64_dvd_94453821.iso C:\\' --targets all --inventoryfile spec/fixtures/litmus_inventory.yaml
115133
116134
- name: Download SQLServer ISO
117135
run: |
118-
bundle exec bolt command run 'gsutil -q cp gs://artifactory-modules/puppetlabs-sqlserver/SQLServer2019CTP2.4-x64-ENU.iso C:\\' --targets ssh_nodes --inventoryfile spec/fixtures/litmus_inventory.yaml
136+
bundle exec bolt command run 'gsutil -q cp gs://artifactory-modules/puppetlabs-sqlserver/SQLServer2019CTP2.4-x64-ENU.iso C:\\' --targets all --inventoryfile spec/fixtures/litmus_inventory.yaml
119137
120138
- name: Set Environment Variable
121139
run: |
122140
pass=`grep -oP '(?<=password: ).*' spec/fixtures/litmus_inventory.yaml`
123-
bundle exec bolt command run "[Environment]::SetEnvironmentVariable('pass', '$pass', 'Machine')" --targets ssh_nodes --inventoryfile spec/fixtures/litmus_inventory.yaml
141+
bundle exec bolt command run "[Environment]::SetEnvironmentVariable('pass', '$pass', 'Machine')" --targets all --inventoryfile spec/fixtures/litmus_inventory.yaml
124142
125143
- name: Run acceptance tests
126144
run: |

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)