9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [v2.6.2](https://github.com/puppetlabs/puppetlabs-sqlserver/tree/v2.6.2) (2020-01-21)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-sqlserver/compare/v2.6.1...v2.6.2)

### Fixed

- \(MODULES-10384\) - Registry value check tightened [\#343](https://github.com/puppetlabs/puppetlabs-sqlserver/pull/343) ([david22swan](https://github.com/david22swan))
- \(MODULES-10335\) - Update exec's title to be unique [\#341](https://github.com/puppetlabs/puppetlabs-sqlserver/pull/341) ([david22swan](https://github.com/david22swan))

## [v2.6.1](https://github.com/puppetlabs/puppetlabs-sqlserver/tree/v2.6.1) (2020-01-16)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-sqlserver/compare/v2.6.0...v2.6.1)
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet_x/sqlserver/features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def self.get_sql_reg_val_features(key_name, reg_val_feat_hash)
begin
vals = open(HKLM, key_name, KEY_READ | KEY64) do |key|
reg_val_feat_hash
.select { |val_name, _| get_reg_key_val(key, val_name, Win32::Registry::REG_DWORD).to_i >= 1 }
.select { |val_name, _| get_reg_key_val(key, val_name, Win32::Registry::REG_DWORD).to_i == 1 }
.map { |_, feat_name| feat_name }
end
rescue Puppet::Util::Windows::Error # subkey doesn't exist #rubocop:disable Lint/HandleExceptions
Expand Down
4 changes: 2 additions & 2 deletions manifests/sp_configure.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}

if $restart {
Sqlserver_tsql["sp_configure-${instance}-${config_name}"] ~> Exec["restart-service-${service_name}"]
Sqlserver_tsql["sp_configure-${instance}-${config_name}"] ~> Exec["restart-service-${service_name}-${config_name}"]
}

sqlserver_tsql{ "sp_configure-${instance}-${config_name}":
Expand All @@ -51,7 +51,7 @@
require => Sqlserver::Config[$instance]
}

exec{"restart-service-${service_name}":
exec{"restart-service-${service_name}-${config_name}":
command => template('sqlserver/restart_service.ps1.erb'),
provider => powershell,
logoutput => true,
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-sqlserver",
"version": "2.6.1",
"version": "2.6.2",
"author": "puppetlabs",
"summary": "The `sqlserver` module installs and manages MS SQL Server 2012, 2014, 2016, 2017, and 2019 on Windows systems.",
"license": "proprietary",
Expand Down
44 changes: 44 additions & 0 deletions spec/acceptance/sqlserver_database_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def run_sql_query_opts(query, expected_row_count)
sqlserver::database{'#{@db_name}':
ensure => 'absent',
}
sqlserver::database{'#{@db_name}-2':
ensure => 'absent',
}
MANIFEST
ensure_sqlserver_database(pp)
end
Expand Down Expand Up @@ -310,5 +313,46 @@ def run_sql_query_opts(query, expected_row_count)
run_sql_query(host, run_sql_query_opts(query, 1))
# rubocop:enable RSpec/InstanceVariable
end

it 'Test Case MODULES-10335: Create two database with seperate sp_configure', tier_low: true do
pp = <<-MANIFEST
sqlserver::config{'MSSQLSERVER':
admin_user => 'sa',
admin_pass => 'Pupp3t1@',
}
sqlserver::sp_configure{ 'sp_config4db':
config_name => 'contained database authentication',
value => 1,
reconfigure => true,
instance => 'MSSQLSERVER',
}
sqlserver::database{ '#{@db_name}':
require => Sqlserver::Sp_configure['sp_config4db']
}
sqlserver_tsql{'testsqlserver_tsql':
instance => 'MSSQLSERVER',
database => '#{@db_name}',
command => "CREATE TABLE #{@table_name} (id INT, name VARCHAR(20), email VARCHAR(20));",
require => Sqlserver::Database['#{@db_name}'],
}
sqlserver::sp_configure{ 'sp_config5db':
config_name => 'contained database authentication',
value => 1,
reconfigure => true,
instance => 'MSSQLSERVER',
}
sqlserver::database{ '#{@db_name}-2':
require => Sqlserver::Sp_configure['sp_config5db']
}
sqlserver_tsql{'testsqlserver_tsql':
instance => 'MSSQLSERVER',
database => '#{@db_name}-2',
command => "CREATE TABLE #{@table_name} (id INT, name VARCHAR(20), email VARCHAR(20));",
require => Sqlserver::Database['#{@db_name}-2'],
}
MANIFEST
ensure_sqlserver_database(pp)
# rubocop:enable RSpec/InstanceVariable
end
end
end
2 changes: 1 addition & 1 deletion spec/acceptance/z_last_sqlserver_features_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def ensure_sql_features(features, ensure_val = 'present')
end

context 'can remove independent feature' do
if sql_version == '2016'
if sql_version.to_i >= 2016
all_possible_features = ['BC', 'Conn', 'SDK', 'IS', 'MDS', 'DQC']
features = ['BC', 'Conn', 'SDK', 'IS', 'MDS', 'DQC']
else
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/sp_configure_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

describe 'service' do
it 'is defined' do
is_expected.to contain_exec('restart-service-MSSQLSERVER').with_refreshonly(true)
is_expected.to contain_exec('restart-service-MSSQLSERVER-filestream access level').with_refreshonly(true)
end
end
end