Showing with 21 additions and 12 deletions.
  1. +1 −1 .travis.yml
  2. +10 −0 CHANGELOG.md
  3. +3 −3 lib/puppet_x/sqlserver/features.rb
  4. +2 −2 metadata.json
  5. +5 −6 spec/acceptance/sqlserver_instance_spec.rb
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ before_install:
matrix:
fast_finish: true
include:
- rvm: 2.4.0
- rvm: 2.4.1
bundler_args: --without system_tests
env: PUPPET_GEM_VERSION="~> 5.0"
- rvm: 2.1.9
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 2017-12-5 - Supported Release 2.0.2

### Summary
Small release with critical bug fix for sql instance install idempotency.

#### Fixed

- Fix bug where Puppet will not detect existing sql instances properly
attempt to reinstall an instance that already exists ([MODULES-6022](https://tickets.puppetlabs.com/browse/MODULES-6022))

## 2017-11-15 - Supported Release 2.0.1

### Summary
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet_x/sqlserver/features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ def self.get_instance_info(version, sql_instance)
# it's possible to request information for a valid instance_name but not for version. In this case
# we just return nil.
return nil if sql_instance['reg_root'].nil?

feats = sql_instance['reg_root'].map do |reg_root|
get_instance_features(reg_root, sql_instance['name'])
feats = []
sql_instance['reg_root'].each do |reg_root|
feats += get_instance_features(reg_root, sql_instance['name'])
end
sql_instance.merge({'features' => feats.uniq})
end
Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "puppetlabs-sqlserver",
"version": "2.0.1",
"version": "2.0.2",
"author": "Puppet Inc",
"summary": "The `sqlserver` module installs and manages MS SQL Server 2012, 2014 and 2016 on Windows systems.",
"license": "proprietary",
"source": "https://tickets.puppet.com/browse/MODULES/component/12400",
"source": "https://github.com/puppetlabs/puppetlabs-sqlserver",
"project_page": "https://github.com/puppetlabs/puppetlabs-sqlserver",
"issues_url": "https://tickets.puppet.com/browse/MODULES/component/12400",
"tags": [
Expand Down
11 changes: 5 additions & 6 deletions spec/acceptance/sqlserver_instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ def ensure_sqlserver_instance(features, inst_name, ensure_val = 'present', sysad

pp = ERB.new(manifest).result(binding)

execute_manifest(pp) do |r|
expect(r.stderr).not_to match(/Error/i)
end
execute_manifest(pp,{:catch_failures => true})
execute_manifest(pp,{:catch_changes => true})
end

#Return options for run_sql_query
Expand Down Expand Up @@ -83,7 +82,7 @@ def sql_query_is_user_sysadmin(username)
inst_name = new_random_instance_name
features = ['SQLEngine', 'Replication', 'FullText', 'DQ']

it "create #{inst_name} instance", :tier_low => true do
it "create #{inst_name} instance", :tier_high => true do
ensure_sqlserver_instance(features, inst_name,'present',"['Administrator','ExtraSQLAdmin']")

validate_sql_install(host, {:version => version}) do |r|
Expand All @@ -99,7 +98,7 @@ def sql_query_is_user_sysadmin(username)
run_sql_query(host, run_sql_query_opts(inst_name, sql_query_is_user_sysadmin('ExtraSQLAdmin'), expected_row_count = 1))
end

it "remove #{inst_name} instance", :tier_low => true do
it "remove #{inst_name} instance", :tier_high => true do
ensure_sqlserver_instance(features, inst_name, 'absent')

# Ensure all features for this instance are removed and the defaults are left alone
Expand All @@ -122,7 +121,7 @@ def sql_query_is_user_sysadmin(username)
ensure_sqlserver_instance(features, inst_name, 'absent')
end

it "create #{inst_name} instance with only one RS feature", :tier_low => true do
it "create #{inst_name} instance with only one RS feature", :tier_high => true do
ensure_sqlserver_instance(features, inst_name)

validate_sql_install(host, {:version => version}) do |r|
Expand Down