Skip to content

[CAT-1065] : Removing support for SQL Server 2012 #455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

## Overview

The sqlserver module installs and manages Microsoft SQL Server 2012, 2014, 2016, 2017, 2019 and 2022 on Windows systems.
The sqlserver module installs and manages Microsoft SQL Server 2014, 2016, 2017, 2019 and 2022 on Windows systems.

## Module Description

Expand Down Expand Up @@ -276,7 +276,7 @@ SQL 2017, 2019 and 2022 detection support has been added. This support is limite

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)

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, 2019 or 2022). The module is able to manage multiple SQL Server instances of the same version.
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.

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.

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/sqlserver_features/mssql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def create
instance_version = PuppetX::Sqlserver::ServerHelper.sql_version_from_install_source(@resource[:source])
Puppet.debug("Installation source detected as version #{instance_version}") unless instance_version.nil?

install_net35(@resource[:windows_feature_source]) if [SQL_2012, SQL_2014].include? instance_version
install_net35(@resource[:windows_feature_source]) if instance_version == SQL_2014

debug "Installing features #{@resource[:features]}"
add_features(@resource[:features])
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/sqlserver_instance/mssql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def create
instance_version = PuppetX::Sqlserver::ServerHelper.sql_version_from_install_source(@resource[:source])
Puppet.debug("Installation source detected as version #{instance_version}") unless instance_version.nil?

install_net35(@resource[:windows_feature_source]) if [SQL_2012, SQL_2014].include? instance_version
install_net35(@resource[:windows_feature_source]) if instance_version == SQL_2014

add_features(@resource[:features])
end
Expand Down
9 changes: 1 addition & 8 deletions lib/puppet_x/sqlserver/features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

require 'puppet/util/windows'

SQL_2012 = 'SQL_2012'
SQL_2014 = 'SQL_2014'
SQL_2016 = 'SQL_2016'
SQL_2017 = 'SQL_2017'
SQL_2019 = 'SQL_2019'
SQL_2022 = 'SQL_2022'

ALL_SQL_VERSIONS = [SQL_2012, SQL_2014, SQL_2016, SQL_2017, SQL_2019, SQL_2022].freeze
ALL_SQL_VERSIONS = [SQL_2014, SQL_2016, SQL_2017, SQL_2019, SQL_2022].freeze

# rubocop:disable Style/ClassAndModuleChildren
module PuppetX
Expand All @@ -20,10 +19,6 @@ class Features # rubocop:disable Style/Documentation
extend Puppet::Util::Windows::Registry

SQL_CONFIGURATION = {
SQL_2012 => {
major_version: 11,
registry_path: '110'
},
SQL_2014 => {
major_version: 12,
registry_path: '120'
Expand Down Expand Up @@ -181,7 +176,6 @@ def self.get_shared_features(version)
# return a hash of version => instance info
#
# {
# "SQL_2012" => {},
# "SQL_2014" => {
# "MSSQLSERVER" => {
# "name" => "MSSQLSERVER",
Expand Down Expand Up @@ -232,7 +226,6 @@ def self.instances
# return a hash of version => shared features array
#
# {
# "SQL_2012" => ["Conn", "SDK", "MDS", "BC", "SSMS", "ADV_SSMS", "IS"],
# "SQL_2014" => []
# }
def self.features
Expand Down
3 changes: 1 addition & 2 deletions lib/puppet_x/sqlserver/server_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def self.is_domain_or_local_user?(user, hostname) # rubocop:disable Naming/Predi
!%r{(^(((nt (authority|service))|#{hostname})\\\w+)$)|^(\w+)$}i.match?(user)
end

# Returns either SQL_2016, SQL_2014 or SQL_2012 if it can determine the SQL Version from the install source
# Returns either SQL_2016 or SQL_2014 if it can determine the SQL Version from the install source
# Returns nil if it can not be determined
def self.sql_version_from_install_source(source_dir)
# Attempt to read the Mediainfo.xml file in the root of the install media
Expand Down Expand Up @@ -48,7 +48,6 @@ def self.sql_version_from_install_source(source_dir)
return SQL_2017 if ver[1].start_with?('14.')
return SQL_2016 if ver[1].start_with?('13.')
return SQL_2014 if ver[1].start_with?('12.')
return SQL_2012 if ver[1].start_with?('11.')

nil
end
Expand Down
3 changes: 1 addition & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "puppetlabs-sqlserver",
"version": "4.1.0",
"author": "puppetlabs",
"summary": "The `sqlserver` module installs and manages MS SQL Server 2012, 2014, 2016, 2017, 2019 and 2022 on Windows systems.",
"summary": "The `sqlserver` module installs and manages MS SQL Server 2014, 2016, 2017, 2019 and 2022 on Windows systems.",
"license": "proprietary",
"source": "https://github.com/puppetlabs/puppetlabs-sqlserver",
"project_page": "https://github.com/puppetlabs/puppetlabs-sqlserver",
Expand Down Expand Up @@ -40,7 +40,6 @@
"mssql",
"sqlserver",
"microsoft",
"sql2012",
"sql2014",
"sql2016",
"sql2017",
Expand Down
4 changes: 0 additions & 4 deletions provision.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
default:
provisioner: vagrant
images: ['gusztavvargadr/windows-server']
release_checks_sql_2012:
provisioner: abs
images: ['win-2012r2-x86_64']
vars: 'sqlversion: sqlserver_2012'
release_checks_sql_2014_parity:
provisioner: abs
images: ['win-2012r2-x86_64']
Expand Down
4 changes: 2 additions & 2 deletions readmes/README_ja_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

## 概要

Microsoft SQL Server 2012、2014、2016、2017は、sqlserverモジュールにより、Windowsシステムでインストールと管理を行います。
Microsoft SQL Server 2014、2016、2017は、sqlserverモジュールにより、Windowsシステムでインストールと管理を行います。

## モジュールの概要

Expand Down Expand Up @@ -1070,7 +1070,7 @@ sys.configurationsで管理するオプションを指定します。有効な

SQL 2017検出サポートが追加されました。このサポートはほかのバージョンの既存の機能に限定されます。SQL 2017に固有の新しい機能は、このリリースには追加されていません。

このモジュールは、指定ホスト上のSQL Serverの単独バージョンのみ管理できます(SQL Server 2012、2014、2016のうちいずれか1つのみ)。このモジュールでは同一バージョンの複数のSQL Serverインスタンスを管理できます。
このモジュールは、指定ホスト上のSQL Serverの単独バージョンのみ管理できます(SQL Server 2014、2016のうちいずれか1つのみ)。このモジュールでは同一バージョンの複数のSQL Serverインスタンスを管理できます。

このモジュールは、SQL Server Native Client SDK (別名SNAC_SDK)を管理できません。SQL ServerのインストールメディアはSDKをインストールできますが、SDKをアンインストールすることはできません。'sqlserver_features' factはSDKの存在を検出します。

Expand Down
4 changes: 2 additions & 2 deletions spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The Acceptance tets run on either a master and agent system or just on a stand-a
First use beaker-hostgenerator to set up a hosts.yml to feed to the acceptance tests by running:

```
bundle exec beaker-hostgenerator windows2012r2-64sql_host%2Cdefault.a%7Bsql_version=2012%7D-redhat7-64mdca --hypervisor abs > spec/acceptance/nodesets/hosts.yml
bundle exec beaker-hostgenerator windows2012r2-64sql_host%2Cdefault.a%7Bsql_version=2014%7D-redhat7-64mdca --hypervisor abs > spec/acceptance/nodesets/hosts.yml
```
This command assumes you're running it from the root of the sqlserver module repo.

Expand All @@ -56,7 +56,7 @@ export ABS_RESOURCE_HOSTS="[{\"hostname\":\"<LOCATION OF WINDOWS HOST TO TEST>\"
e.g. replace "<LOCATION OF WINDOWS HOST TO TEST>\" with "fyzskxlt6edanll.delivery.puppetlabs.net\"

```
export ABS_RESOURCE_REQUESTS_beaker="[{\"windows2012r2-64sql_host.a%7Bsql_version=2012%7D-redhat7-64mdca\":{\"win-2012r2-x86_64\":1,\"redhat-7-x86_64\":1}, \"windows2012r2-64sql_host.a%7Bsql_version=2014%7D-redhat7-64mdca\":{\"win-2012r2-x86_64\":1,\"redhat-7-x86_64\":1}}]"
export ABS_RESOURCE_REQUESTS_beaker="[{\"windows2012r2-64sql_host.a%7Bsql_version=2014%7D-redhat7-64mdca\":{\"win-2012r2-x86_64\":1,\"redhat-7-x86_64\":1}, \"windows2012r2-64sql_host.a%7Bsql_version=2016%7D-redhat7-64mdca\":{\"win-2012r2-x86_64\":1,\"redhat-7-x86_64\":1}}]"

export BEAKER_setfile=spec/acceptance/nodesets/hosts.yml
export BEAKER_keyfile=/var/lib/jenkins/.ssh/id_rsa-acceptance
Expand Down
9 changes: 1 addition & 8 deletions spec/spec_helper_acceptance_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class Helper
SQL_2017_ISO = 'SQLServer2017-x64-ENU.iso'
SQL_2016_ISO = 'en_sql_server_2016_enterprise_with_service_pack_1_x64_dvd_9542382.iso'
SQL_2014_ISO = 'SQLServer2014SP3-FullSlipstream-x64-ENU.iso'
SQL_2012_ISO = 'SQLServer2012SP1-FullSlipstream-ENU-x64.iso'
SQL_ADMIN_USER = 'sa'
SQL_ADMIN_PASS = 'Pupp3t1@'
USER = Helper.instance.run_shell('$env:UserName').stdout.chomp
Expand Down Expand Up @@ -101,12 +100,6 @@ def mount_iso(opts = {})

def base_install(sql_version)
case sql_version.to_i
when 2012
iso_opts = {
folder: QA_RESOURCE_ROOT,
file: SQL_2012_ISO,
drive_letter: 'H'
}
when 2014
iso_opts = {
folder: QA_RESOURCE_ROOT,
Expand Down Expand Up @@ -237,7 +230,7 @@ def validate_sql_install(opts = {}, &block)
end

def get_install_paths(version)
vers = { '2012' => '110', '2014' => '120', '2016' => '130', '2017' => '140', '2019' => '150', '2022' => '160' }
vers = { '2014' => '120', '2016' => '130', '2017' => '140', '2019' => '150', '2022' => '160' }

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

Expand Down
8 changes: 1 addition & 7 deletions spec/sql_testing_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ def run_sql_query(host, opts = {}, &block)

def base_install(sql_version)
case sql_version.to_i
when 2012
iso_opts = {
folder: QA_RESOURCE_ROOT,
file: SQL_2012_ISO,
drive_letter: 'H'
}
when 2014
iso_opts = {
folder: QA_RESOURCE_ROOT,
Expand Down Expand Up @@ -169,7 +163,7 @@ def remove_sql_instances(host, opts = {})
end

def get_install_paths(version)
vers = { '2012' => '110', '2014' => '120', '2016' => '130', '2017' => '140', '2019' => '150', '2022' => '160' }
vers = { '2014' => '120', '2016' => '130', '2017' => '140', '2019' => '150', '2022' => '160' }

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

Expand Down