Skip to content

Commit

Permalink
Merge pull request #234 from glennsarti/modules-5209-release-prep-20
Browse files Browse the repository at this point in the history
(MODULES-5209) Prepare for 2.0.0 release
  • Loading branch information
HAIL9000 committed Aug 4, 2017
2 parents ba2d6a7 + 1f23674 commit baf2b5c
Show file tree
Hide file tree
Showing 59 changed files with 1,165 additions and 804 deletions.
3 changes: 1 addition & 2 deletions .fixtures.yml
@@ -1,6 +1,5 @@
fixtures:
repositories:
"stdlib":
"repo": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
"stdlib": "https://github.com/puppetlabs/puppetlabs-stdlib.git"
symlinks:
sqlserver: "#{source_dir}"
8 changes: 4 additions & 4 deletions .sync.yml
Expand Up @@ -5,14 +5,14 @@ Gemfile:
optional:
':development':
- gem: yard
':system_tests':
- gem: beaker-testmode_switcher
version: '<= 0.2.0'
- gem: master_manipulator
Rakefile:
unmanaged: true
spec/spec_helper.rb:
unmanaged: true
appveyor.yml:
matrix_extras:
- PUPPET_GEM_VERSION: 4.2.3
RUBY_VER: 21-x64
LICENSE:
license_type: 'puppetpe'
NOTICE:
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -10,10 +10,10 @@ before_install:
matrix:
fast_finish: true
include:
- rvm: 2.3.1
- rvm: 2.4.0
bundler_args: --without system_tests
env: PUPPET_GEM_VERSION="~> 4.0"
- rvm: 2.1.7
env: PUPPET_GEM_VERSION="~> 5.0"
- rvm: 2.1.9
bundler_args: --without system_tests
env: PUPPET_GEM_VERSION="~> 4.0"
notifications:
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
@@ -1,13 +1,41 @@
## 2017-08-10 - Supported Release 2.0.0

### Summary

This major release adds support for Microsoft SQL Server 2016

#### Features

- Deprecates the use of `Tools` and `SQL` as installation features ([MODULES-4257](https://tickets.puppet.com/browse/MODULES-4257))
- Added more detailed examples to the README
- Updated with Puppet 4 data types ([MODULES-5126](https://tickets.puppet.com/browse/MODULES-5126))
- Added parameters to manage PolyBase ([MODULES-5070](https://tickets.puppet.com/browse/MODULES-5070))

#### Bug Fixes

- Make .Net installation errors more obvious ([MODULES-5092](https://tickets.puppet.com/browse/MODULES-5092))
- Remove service_ensure parameter as it had no use ([MODULES-5030](https://tickets.puppet.com/browse/MODULES-5030))
- Using as_sysadmin_accounts without AS feature will error ([MODULES-2386](https://tickets.puppet.com/browse/MODULES-2386))
- SNAC_SDK shared feature can not be managed by the module ([FM-5389](https://tickets.puppet.com/browse/FM-5389))
- Purge members from SQL Server Role should actually purge ([MODULES-2543](https://tickets.puppet.com/browse/MODULES-2543))
- Identifiers are properly escaped during database creation ([FM-5021](https://tickets.puppet.com/browse/FM-5021))
- Remove forced TCP connection for SQL management ([MODULES-4915](https://tickets.puppet.com/browse/MODULES-4915))
- Update metadata for Puppet 4 and Puppet 5 ([MODULES-4842](https://tickets.puppet.com/browse/MODULES-4842), [MODULES-5144](https://tickets.puppet.com/browse/MODULES-5144))
- Add test tiering and test mode switcher ([FM-5062](https://tickets.puppet.com/browse/FM-5062), [FM-6141](https://tickets.puppet.com/browse/FM-6141))

## 2017-05-08 - Supported Release 1.2.0

### Summary

This release adds support for internationalization of the module. It also contains Japanese translations for the README, summary and description of the metadata.json and major cleanups in the README. Additional folders have been introduced called locales and readmes where translation files can be found. A number of features and bug fixes are also included in this release.

#### Features

- (MODULES-4334) - Adding locales directory, config.yaml and POT file for i18n.
- Puppet-module-gems now implemented

#### Bug Fixes

- (MODULES-4528) Replace Puppet.version comparison with Puppet::Util::Package.versioncmp
- (MODULES-4667) Update beaker tests for Jenkins CI

Expand Down
19 changes: 11 additions & 8 deletions Gemfile
Expand Up @@ -43,14 +43,14 @@ minor_version = "#{ruby_version_segments[0]}.#{ruby_version_segments[1]}"
#end

group :development do
gem "puppet-module-posix-default-r#{minor_version}", :require => false, :platforms => "ruby"
gem "puppet-module-win-default-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
gem "puppet-module-posix-dev-r#{minor_version}", :require => false, :platforms => "ruby"
gem "puppet-module-win-dev-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
gem "json_pure", '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "fast_gettext", '1.1.0', :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", :require => false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "yard", :require => false
gem "puppet-module-posix-default-r#{minor_version}", :require => false, :platforms => "ruby"
gem "puppet-module-win-default-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
gem "puppet-module-posix-dev-r#{minor_version}", :require => false, :platforms => "ruby"
gem "puppet-module-win-dev-r#{minor_version}", '0.0.7', :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
gem "json_pure", '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "fast_gettext", '1.1.0', :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", :require => false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "yard", :require => false
end

group :system_tests do
Expand All @@ -61,6 +61,9 @@ group :system_tests do
gem "beaker-rspec", *location_for(ENV['BEAKER_RSPEC_VERSION'])
gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'])
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
gem "puppet-blacksmith", '~> 3.4', :require => false
gem "beaker-testmode_switcher", '<= 0.2.0', :require => false
gem "master_manipulator", :require => false
end

gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])
Expand Down
116 changes: 101 additions & 15 deletions README.md
Expand Up @@ -80,13 +80,6 @@ This example creates the same MS SQL instance as shown above with additional opt

### Install SQL Server tools and features not specific to a SQL Server instance

```puppet
sqlserver_features { 'Generic Features':
source => 'E:/',
features => ['Tools'],
}
```

```puppet
sqlserver_features { 'Generic Features':
source => 'E:/',
Expand Down Expand Up @@ -184,6 +177,81 @@ sqlserver_tsql{ 'Always running':
}
```

### Advanced example

This advanced example:

* Installs the basic SQL Server Engine from installation media mounted at 'D:\' with TCP Enabled and various directories set.

* Uses only Windows-based authentication and installs with only the user that Puppet is executing as. Note that the 'sql_sysadmin_accounts' is only applicable during the instance installation and is not actively enforced.

* Creates a `sqlserver::config` resource, which is used in later resources to connect to the newly created instance. As we support only Windows-based authentication, a username and password is not required.

* Creates a local group called 'DB Administrators' and ensures that it is SQL System Administrator (sysadmin role); also creates the account that Puppet uses to install and manage the instance.

* Ensures that the advanced options for `sp_configure` are enabled, so that Puppet can manage the `max memory` setting for the instance.

* Ensure that the `max memory` (MB) configuration item is set to 2048 megabytes.

```puppet
$sourceloc = 'D:/'
# Install a SQL Server default instance
sqlserver_instance{'MSSQLSERVER':
source => $sourceloc,
features => ['SQLEngine'],
sql_sysadmin_accounts => [$facts['id']],
install_switches => {
'TCPENABLED' => 1,
'SQLBACKUPDIR' => 'C:\\MSSQLSERVER\\backupdir',
'SQLTEMPDBDIR' => 'C:\\MSSQLSERVER\\tempdbdir',
'INSTALLSQLDATADIR' => 'C:\\MSSQLSERVER\\datadir',
'INSTANCEDIR' => 'C:\\Program Files\\Microsoft SQL Server',
'INSTALLSHAREDDIR' => 'C:\\Program Files\\Microsoft SQL Server',
'INSTALLSHAREDWOWDIR' => 'C:\\Program Files (x86)\\Microsoft SQL Server'
}
}
# Resource to connect to the DB instance
sqlserver::config { 'MSSQLSERVER':
admin_login_type => 'WINDOWS_LOGIN'
}
# Enforce SQL Server Administrators
$local_dba_group_name = 'DB Administrators'
$local_dba_group_netbios_name = "${facts['hostname']}\\DB Administrators"
group { $local_dba_group_name:
ensure => present
}
-> sqlserver::login { $local_dba_group_netbios_name :
login_type => 'WINDOWS_LOGIN',
}
-> sqlserver::role { 'sysadmin':
ensure => 'present',
instance => 'MSSQLSERVER',
type => 'SERVER',
members => [$local_dba_group_netbios_name, $facts['id']],
}
# Enforce memory consumption
sqlserver_tsql {'check advanced sp_configure':
command => 'EXEC sp_configure \'show advanced option\', \'1\'; RECONFIGURE;',
onlyif => 'sp_configure @configname=\'max server memory (MB)\'',
instance => 'MSSQLSERVER'
}
-> sqlserver::sp_configure { 'MSSQLSERVER-max memory':
config_name => 'max server memory (MB)',
instance => 'MSSQLSERVER',
reconfigure => true,
restart => true,
value => 2048
}
```

## Reference

### Types
Expand All @@ -203,8 +271,10 @@ Default: 'present'.
##### `features`

*Required.*

Specifies one or more features to manage. Valid options: 'BC', 'Conn', 'SSMS', 'ADV_SSMS', 'SDK', 'IS', 'MDS', and 'Tools' (the Tools feature includes SSMS, ADV_SSMS, and Conn).

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

The 'Tools' value for this setting is deprecated. Specify 'BC', 'SSMS', 'ADV_SSMS', 'Conn', and 'SDK' explicitly.

##### `install_switches`

Expand Down Expand Up @@ -294,7 +364,9 @@ Default: 'present'.

##### `features`

*Required.* Specifies one or more features to manage. The list of top-level features includes 'SQL', 'AS', and 'RS'. The 'SQL' feature includes the Database Engine, Replication, Full-Text, and Data Quality Services (DQS) server. Valid options: an array containing one or more of the strings 'SQL', 'SQLEngine', 'Replication', 'FullText', 'DQ', 'AS', and 'RS'.
*Required.* Specifies one or more features to manage. The list of top-level features includes 'AS' and 'RS'. Valid options: an array containing one or more of the strings 'SQL', 'SQLEngine', 'Replication', 'FullText', 'DQ', 'AS', 'RS', 'POLYBASE', and 'ADVANCEDANALYTICS'.

The 'SQL' value for this setting is deprecated. Specify 'DQ', 'FullText', 'Replication', and 'SQLEngine' explicitly.

##### `install_switches`

Expand All @@ -319,6 +391,22 @@ Specifies a product key for SQL Server. Valid options: a string containing a val

Default: `undef`.

##### `polybase_svc_account`

**Applicable only if the POLYBASE feature for SQL Server 2016 is being installed.**

Specifies a domain or system account for the Polybase Engine service.

Valid options: a string specifying an existing username.

##### `polybase_svc_password`

**Applicable only if the POLYBASE feature for SQL Server 2016 is being installed.**

Specifies the password for the Polybase Engine service

Valid options: a string specifying a valid password.

##### `rs_svc_account`

Specifies a domain or system account to be used by the report service. Valid options: a string; cannot include any of the following characters: `'"/ \ [ ] : ; | = , + * ? < >'`. If you specify a domain user account, the domain must be less than 254 characters and the username must be less than 20 characters.
Expand All @@ -343,10 +431,6 @@ Specifies a security mode for SQL Server. Valid options: 'SQL'. If not specified

Default: `undef`.

##### `service_ensure`

Specifies whether the SQL Server service should be running. Valid options: 'automatic' (Puppet starts the service if it's not running), 'manual' (Puppet takes no action), and 'disable' (Puppet stops the service if it's running).

##### `source`

*Required.*
Expand Down Expand Up @@ -985,7 +1069,9 @@ Terminology differs somewhat between various database systems; please refer to t

## Limitations

This module is available only for Windows Server 2012 or 2012 R2, and works with Puppet Enterprise 3.7 and later.
This module can manage only a single version of SQL Server on a given 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.

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.

## Development

Expand Down
22 changes: 22 additions & 0 deletions Rakefile
Expand Up @@ -21,3 +21,25 @@ task :validate do
sh "erb -P -x -T '-' #{template} | ruby -c"
end
end

require 'rspec/core/rake_task'
desc 'test tiering'
RSpec::Core::RakeTask.new(:test_tier) do |t|
# Setup rspec opts
t.rspec_opts = ['--color']

# TEST_TIERS env variable is a comma separated list of tiers to run. e.g. low, medium, high
if ENV['TEST_TIERS']
test_tiers = ENV['TEST_TIERS'].split(',')
raise 'TEST_TIERS env variable must have at least 1 tier specified. low, medium or high (comma separated).' if test_tiers.count == 0
test_tiers.each do |tier|
raise "#{tier} not a valid test tier." unless %w(low medium high).include?(tier)
t.rspec_opts.push("--tag tier_#{tier}")
end
else
puts 'TEST_TIERS env variable not defined. Defaulting to run all tests.'
end

# Implement an override for the pattern with BEAKER_PATTERN env variable.
t.pattern = ENV['BEAKER_PATTERN'] ? ENV['BEAKER_PATTERN'] : 'spec/acceptance'
end
24 changes: 17 additions & 7 deletions appveyor.yml
Expand Up @@ -14,18 +14,28 @@ environment:
RUBY_VER: 21
- PUPPET_GEM_VERSION: ~> 4.0
RUBY_VER: 21-x64
- PUPPET_GEM_VERSION: ~> 4.0
RUBY_VER: 23
- PUPPET_GEM_VERSION: ~> 4.0
RUBY_VER: 23-x64
- PUPPET_GEM_VERSION: 4.2.3
RUBY_VER: 21-x64
- PUPPET_GEM_VERSION: 4.2.3
- PUPPET_GEM_VERSION: ~> 5.0
RUBY_VER: 24
- PUPPET_GEM_VERSION: ~> 5.0
RUBY_VER: 24-x64
- PUPPET_GEM_VERSION: 4.7.1
RUBY_VER: 21-x64
matrix:
fast_finish: true
install:
- SET PATH=C:\Ruby%RUBY_VER%\bin;%PATH%
- ps: |
# AppVeyor appears to have OpenSSL headers available already
# which msys2 would normally install with:
# pacman -S mingw-w64-x86_64-openssl --noconfirm
#
if ( $(ruby --version) -match "^ruby\s+2\.4" ) {
Write-Output "Building OpenSSL gem ~> 2.0.4 to fix Ruby 2.4 / AppVeyor issue"
gem install openssl --version '~> 2.0.4' --no-ri --no-rdoc
}
gem list openssl
ruby -ropenssl -e 'puts \"OpenSSL Version - #{OpenSSL::OPENSSL_VERSION}\"; puts \"OpenSSL Library Version - #{OpenSSL::OPENSSL_LIBRARY_VERSION}\"'
- bundle install --jobs 4 --retry 2 --without system_tests
- type Gemfile.lock
build: off
Expand Down
Expand Up @@ -10,6 +10,7 @@
# @raise [Puppet::ParserError] Instance name can not be larger than 16 characters
# @raise [Puppet::ParserError] Instance name can not start or end with underscore (_)
#

module Puppet::Parser::Functions
newfunction(:sqlserver_validate_instance_name, :docs => <<DOC) do |args|
Validate the MS SQL Instance name based on what Microsoft has set within the document located at
Expand Down
11 changes: 0 additions & 11 deletions lib/puppet/parser/functions/sqlserver_validate_on_off.rb

This file was deleted.

19 changes: 0 additions & 19 deletions lib/puppet/parser/functions/sqlserver_validate_svrroles_hash.rb

This file was deleted.

0 comments on commit baf2b5c

Please sign in to comment.