Skip to content

Commit d2a0f07

Browse files
authored
Merge pull request #285 from RandomNoun7/tickets/master/MODULES-8438-Install-2019
(MODULES-8438) Install 2019
2 parents 37dd499 + b8b5144 commit d2a0f07

File tree

9 files changed

+25
-11
lines changed

9 files changed

+25
-11
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
66

77
## [Unreleased]
88

9+
## Added
10+
11+
- Add support for installing and managing SQL 2019 instances ([MODULES-8438](https://tickets.puppetlabs.com/browse/MODULES-8438))
12+
913
## [2.2.0] - 2018-12-3
1014

1115
### Added

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
## Overview
2222

23-
The sqlserver module installs and manages Microsoft SQL Server 2012, 2014, 2016 and 2017 on Windows systems.
23+
The sqlserver module installs and manages Microsoft SQL Server 2012, 2014, 2016, 2017, 2019 on Windows systems.
2424

2525
## Module Description
2626

@@ -392,15 +392,15 @@ Default: `undef`.
392392

393393
##### `polybase_svc_account`
394394

395-
**Applicable only if the POLYBASE feature for SQL Server 2016 is being installed.**
395+
**Applicable only if the POLYBASE feature for SQL Server 2016 or above is being installed.**
396396

397397
Specifies a domain or system account for the Polybase Engine service.
398398

399399
Valid options: a string specifying an existing username.
400400

401401
##### `polybase_svc_password`
402402

403-
**Applicable only if the POLYBASE feature for SQL Server 2016 is being installed.**
403+
**Applicable only if the POLYBASE feature for SQL Server 2016 or above is being installed.**
404404

405405
Specifies the password for the Polybase Engine service
406406

@@ -1068,9 +1068,9 @@ Terminology differs somewhat between various database systems; please refer to t
10681068

10691069
## Limitations
10701070

1071-
SQL 2017 detection support has been added. This support is limited to functionality already present for other versions. No new SQL 2017 specific functionality has been added in this release.
1071+
SQL 2017 and 2019 detection support has been added. This support is limited to functionality already present for other versions. No new SQL 2017 or above specific functionality has been added in this release.
10721072

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

10751075
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.
10761076

lib/puppet/provider/sqlserver_features/mssql.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,11 @@ def create
122122
warn "Uninstalling all sql server features not tied into an instance because an empty array was passed, please use ensure absent instead."
123123
destroy
124124
else
125+
125126
instance_version = PuppetX::Sqlserver::ServerHelper.sql_version_from_install_source(@resource[:source])
126127
Puppet.debug("Installation source detected as version #{instance_version}") unless instance_version.nil?
127128

128-
installNet35(@resource[:windows_feature_source]) unless instance_version == SQL_2016
129+
installNet35(@resource[:windows_feature_source]) unless [SQL_2016, SQL_2017, SQL_2019].include? instance_version
129130

130131
debug "Installing features #{@resource[:features]}"
131132
add_features(@resource[:features])

lib/puppet/provider/sqlserver_instance/mssql.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def create
101101
instance_version = PuppetX::Sqlserver::ServerHelper.sql_version_from_install_source(@resource[:source])
102102
Puppet.debug("Installation source detected as version #{instance_version}") unless instance_version.nil?
103103

104-
installNet35(@resource[:windows_feature_source]) unless instance_version == SQL_2016
104+
installNet35(@resource[:windows_feature_source]) unless [SQL_2016, SQL_2017, SQL_2019].include? instance_version
105105

106106
add_features(@resource[:features])
107107
end

lib/puppet/type/sqlserver_instance.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@
110110
end
111111

112112
newparam(:polybase_svc_account, :parent => Puppet::Property::SqlserverLogin) do
113-
desc 'The account used by the Polybase Engine service. Only applicable for SQL Server 2016.'
113+
desc 'The account used by the Polybase Engine service. Only applicable for SQL Server 2016+.'
114114

115115
end
116116

117117
newparam(:polybase_svc_password) do
118-
desc 'The password for the Polybase Engine service account. Only applicable for SQL Server 2016.'
118+
desc 'The password for the Polybase Engine service account. Only applicable for SQL Server 2016+.'
119119

120120
end
121121

lib/puppet_x/sqlserver/features.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
SQL_2014 ||= 'SQL_2014'
55
SQL_2016 ||= 'SQL_2016'
66
SQL_2017 ||= 'SQL_2017'
7+
SQL_2019 ||= 'SQL_2019'
78

8-
ALL_SQL_VERSIONS ||= [SQL_2012, SQL_2014, SQL_2016, SQL_2017]
9+
ALL_SQL_VERSIONS ||= [SQL_2012, SQL_2014, SQL_2016, SQL_2017, SQL_2019]
910

1011
module PuppetX
1112
module Sqlserver
@@ -32,6 +33,10 @@ class Features
3233
SQL_2017 => {
3334
:major_version => 14,
3435
:registry_path => '140',
36+
},
37+
SQL_2019 => {
38+
:major_version => 15,
39+
:registry_path => '150',
3540
}
3641
}
3742

lib/puppet_x/sqlserver/server_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def self.sql_version_from_install_source(source_dir)
4242
ver = content.match('"(.+)"')
4343
return nil if ver.nil?
4444

45+
return SQL_2019 if ver[1].start_with?('15.')
46+
return SQL_2017 if ver[1].start_with?('14.')
4547
return SQL_2016 if ver[1].start_with?('13.')
4648
return SQL_2014 if ver[1].start_with?('12.')
4749
return SQL_2012 if ver[1].start_with?('11.')

metadata.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "puppetlabs-sqlserver",
33
"version": "2.2.0",
44
"author": "Puppet Inc",
5-
"summary": "The `sqlserver` module installs and manages MS SQL Server 2012, 2014, 2016 and 2017 on Windows systems.",
5+
"summary": "The `sqlserver` module installs and manages MS SQL Server 2012, 2014, 2016, 2017, and 2019 on Windows systems.",
66
"license": "proprietary",
77
"source": "https://github.com/puppetlabs/puppetlabs-sqlserver",
88
"project_page": "https://github.com/puppetlabs/puppetlabs-sqlserver",
@@ -38,6 +38,7 @@
3838
"sql2014",
3939
"sql2016",
4040
"sql2017",
41+
"sql2019",
4142
"tsql",
4243
"database"
4344
],

spec/spec_helper_acceptance.rb

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
WIN_ISO_ROOT = "http://int-resources.ops.puppetlabs.net/ISO/Windows/2012"
1212
WIN_2012R2_ISO = "en_windows_server_2012_r2_with_update_x64_dvd_6052708.iso"
1313
QA_RESOURCE_ROOT = "http://int-resources.ops.puppetlabs.net/QA_resources/microsoft_sql/iso/"
14+
SQL_2019_ISO = "en_sql_server_2019_developer_x64_CTP2.iso"
1415
SQL_2016_ISO = "en_sql_server_2016_enterprise_with_service_pack_1_x64_dvd_9542382.iso"
1516
SQL_2014_ISO = "SQLServer2014-x64-ENU.iso"
1617
SQL_2012_ISO = "SQLServer2012SP1-FullSlipstream-ENU-x64.iso"

0 commit comments

Comments
 (0)