Skip to content

(FM-5389) Fix sql_features when installing SNAC_SDK #219

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 3 commits into from
Jun 21, 2017
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
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Default: 'present'.

*Required.*

Specifies one or more features to manage. Valid options: 'BC', 'Conn', 'SSMS', 'ADV_SSMS', 'SDK', 'IS', 'MDS', 'BOL', 'DREPLAY_CTLR', 'DREPLAY_CLT', 'SNAC_SDK'.
Specifies one or more features to manage. Valid options: 'BC', 'Conn', 'SSMS', 'ADV_SSMS', 'SDK', 'IS', 'MDS', 'BOL', 'DREPLAY_CTLR', 'DREPLAY_CLT'.

The 'Tools' feature is deprecated. Instead specify 'BC', 'SSMS', 'ADV_SSMS', 'Conn', and 'SDK' explicitly.

Expand Down Expand Up @@ -980,6 +980,10 @@ Terminology differs somewhat between various database systems; please refer to t

This module is available only for Windows Server 2012 or 2012 R2, and works with Puppet Enterprise 3.7 and later.

This module can only manage a single SQL Server version on a 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.

The SQL Server Native Client SDK (also known as SNAC_SDK) can not be managed by this module. The SQL Server installation media is able to install the SDK but is not able to uninstall the SDK. Note that the 'sqlserver_features' fact will detect the presence of the SDK.

## Development

This module was built by Puppet specifically for use with Puppet Enterprise (PE).
Expand Down
23 changes: 13 additions & 10 deletions lib/puppet/provider/sqlserver_features/mssql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,25 @@ def self.instances
result = Facter.value(:sqlserver_features)
debug "Parsing result #{result}"

# Due to MODULES-5060 we can only output one feature set. If we output
# multiple then it is not possible to install or uninstall due to multiple
# resources with the same name. Also due to the SQL Native Client not
# being unique across SQL Server versions (e.g. SQL 2016 installs Native Client
# with a version that matches for SQL 2012) the features need to be collated
# across all versions and then aggregated into a single resource
featurelist = []
ALL_SQL_VERSIONS.each do |sql_version|
next if result[sql_version].empty?
featurelist += result[sql_version]
end

unless featurelist.count.zero?
instance_props = {:name => "Generic Features",
:ensure => :present,
:features => result[sql_version].sort
:features => featurelist.uniq.sort
}
debug "Parsed features = #{instance_props[:features]}"

instance = new(instance_props)
debug "Created instance #{instance}"
instances << instance

# Due to MODULES-5060 we can only output one feature set. If we output
# multiple then it is not possible to install or uninstall due to multiple
# resources with the same name.
break
instances = [new(instance_props)]
end

instances
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/sqlserver_features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
newproperty(:features, :array_matching => :all) do
desc 'Specifies features to install, uninstall, or upgrade. The list of top-level features include
BC, Conn, SSMS, ADV_SSMS, SDK, IS and MDS.'
newvalues(:Tools, :BC, :Conn, :SSMS, :ADV_SSMS, :SDK, :IS, :MDS, :BOL, :DREPLAY_CTLR, :DREPLAY_CLT, :SNAC_SDK)
newvalues(:Tools, :BC, :Conn, :SSMS, :ADV_SSMS, :SDK, :IS, :MDS, :BOL, :DREPLAY_CTLR, :DREPLAY_CLT)
munge do |value|
if PuppetX::Sqlserver::ServerHelper.is_super_feature(value)
Puppet.deprecation_warning("Using #{value} is deprecated for features in sql_features resources")
Expand Down
1 change: 0 additions & 1 deletion lib/puppet_x/sqlserver/features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def self.get_shared_features(version)
'SQL_DReplay_Controller' => 'DREPLAY_CTLR', # Distributed Replay Controller
'SQL_DReplay_Client' => 'DREPLAY_CLT', # Distributed Replay Client
'sql_shared_mr' => 'SQL_SHARED_MR', # R Server (Standalone)
'SQL_SNAC_SDK' => 'SNAC_SDK', # SQL Client Connectivity SDK

# also WMI: SqlService WHERE SQLServiceType = 4 # MsDtsServer
'SQL_DTS_Full' => 'IS', # Integration Services
Expand Down