From 170ddc9bc21fbd976f70488a74d11658d058bc28 Mon Sep 17 00:00:00 2001 From: rajat-puppet Date: Mon, 28 Aug 2023 14:06:02 +0530 Subject: [PATCH] Removing support and textual occurences of SQLSERVER 2012 --- README.md | 4 ++-- lib/puppet/provider/sqlserver_features/mssql.rb | 2 +- lib/puppet/provider/sqlserver_instance/mssql.rb | 2 +- lib/puppet_x/sqlserver/features.rb | 9 +-------- lib/puppet_x/sqlserver/server_helper.rb | 3 +-- metadata.json | 3 +-- provision.yaml | 4 ---- readmes/README_ja_JP.md | 4 ++-- spec/README.md | 4 ++-- spec/spec_helper_acceptance_local.rb | 9 +-------- spec/sql_testing_helpers.rb | 8 +------- 11 files changed, 13 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 7453ba7e..8b3c6d6e 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. diff --git a/lib/puppet/provider/sqlserver_features/mssql.rb b/lib/puppet/provider/sqlserver_features/mssql.rb index 564b4fdb..1d01332e 100644 --- a/lib/puppet/provider/sqlserver_features/mssql.rb +++ b/lib/puppet/provider/sqlserver_features/mssql.rb @@ -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]) diff --git a/lib/puppet/provider/sqlserver_instance/mssql.rb b/lib/puppet/provider/sqlserver_instance/mssql.rb index b7cd3985..532a212e 100644 --- a/lib/puppet/provider/sqlserver_instance/mssql.rb +++ b/lib/puppet/provider/sqlserver_instance/mssql.rb @@ -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 diff --git a/lib/puppet_x/sqlserver/features.rb b/lib/puppet_x/sqlserver/features.rb index 20f649de..90491602 100644 --- a/lib/puppet_x/sqlserver/features.rb +++ b/lib/puppet_x/sqlserver/features.rb @@ -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 @@ -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' @@ -181,7 +176,6 @@ def self.get_shared_features(version) # return a hash of version => instance info # # { - # "SQL_2012" => {}, # "SQL_2014" => { # "MSSQLSERVER" => { # "name" => "MSSQLSERVER", @@ -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 diff --git a/lib/puppet_x/sqlserver/server_helper.rb b/lib/puppet_x/sqlserver/server_helper.rb index f2daed42..68537817 100644 --- a/lib/puppet_x/sqlserver/server_helper.rb +++ b/lib/puppet_x/sqlserver/server_helper.rb @@ -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 @@ -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 diff --git a/metadata.json b/metadata.json index 946913a3..79d28cfc 100644 --- a/metadata.json +++ b/metadata.json @@ -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", @@ -40,7 +40,6 @@ "mssql", "sqlserver", "microsoft", - "sql2012", "sql2014", "sql2016", "sql2017", diff --git a/provision.yaml b/provision.yaml index 86837757..f1ca54cc 100644 --- a/provision.yaml +++ b/provision.yaml @@ -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'] diff --git a/readmes/README_ja_JP.md b/readmes/README_ja_JP.md index 24c65712..d649a283 100644 --- a/readmes/README_ja_JP.md +++ b/readmes/README_ja_JP.md @@ -20,7 +20,7 @@ ## 概要 -Microsoft SQL Server 2012、2014、2016、2017は、sqlserverモジュールにより、Windowsシステムでインストールと管理を行います。 +Microsoft SQL Server 2014、2016、2017は、sqlserverモジュールにより、Windowsシステムでインストールと管理を行います。 ## モジュールの概要 @@ -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の存在を検出します。 diff --git a/spec/README.md b/spec/README.md index cc350543..7cf768ff 100644 --- a/spec/README.md +++ b/spec/README.md @@ -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. @@ -56,7 +56,7 @@ export ABS_RESOURCE_HOSTS="[{\"hostname\":\"\" e.g. replace "\" 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 diff --git a/spec/spec_helper_acceptance_local.rb b/spec/spec_helper_acceptance_local.rb index 18a9767f..db2dfd38 100644 --- a/spec/spec_helper_acceptance_local.rb +++ b/spec/spec_helper_acceptance_local.rb @@ -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 @@ -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, @@ -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) diff --git a/spec/sql_testing_helpers.rb b/spec/sql_testing_helpers.rb index 55a986b8..aacd6f1b 100644 --- a/spec/sql_testing_helpers.rb +++ b/spec/sql_testing_helpers.rb @@ -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, @@ -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)