Showing with 29 additions and 50 deletions.
  1. +1 −1 .github/workflows/release.yml
  2. +6 −0 .rubocop.yml
  3. +1 −1 .vscode/extensions.json
  4. +8 −0 CHANGELOG.md
  5. +3 −4 Gemfile
  6. +0 −19 REFERENCE.md
  7. +0 −13 lib/puppet/functions/sqlserver/password.rb
  8. +4 −1 manifests/login.pp
  9. +4 −1 manifests/user.pp
  10. +2 −2 metadata.json
  11. +0 −8 spec/functions/password_spec.rb
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Publish module"

on:
workflow_dispatch:

jobs:
release:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main"
Expand Down
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@ Lint/DuplicateBranch:
Enabled: false
Lint/DuplicateMagicComment:
Enabled: false
Lint/DuplicateMatchPattern:
Enabled: false
Lint/DuplicateRegexpCharacterClassElement:
Enabled: false
Lint/EmptyBlock:
Expand Down Expand Up @@ -645,6 +647,8 @@ Style/ComparableClamp:
Enabled: false
Style/ConcatArrayLiterals:
Enabled: false
Style/DataInheritance:
Enabled: false
Style/DirEmpty:
Enabled: false
Style/DocumentDynamicEvalDefinition:
Expand Down Expand Up @@ -713,6 +717,8 @@ Style/RedundantHeredocDelimiterQuotes:
Enabled: false
Style/RedundantInitialize:
Enabled: false
Style/RedundantLineContinuation:
Enabled: false
Style/RedundantSelfAssignmentBranch:
Enabled: false
Style/RedundantStringEscape:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"recommendations": [
"puppet.puppet-vscode",
"rebornix.Ruby"
"Shopify.ruby-lsp"
]
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ 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).

## [v5.0.1](https://github.com/puppetlabs/puppetlabs-sqlserver/tree/v5.0.1) - 2024-02-22

[Full Changelog](https://github.com/puppetlabs/puppetlabs-sqlserver/compare/v5.0.0...v5.0.1)

### Fixed

- (CAT-1728) - Unable to use password function as deferred function [#469](https://github.com/puppetlabs/puppetlabs-sqlserver/pull/469) ([Ramesh7](https://github.com/Ramesh7))

## [v5.0.0](https://github.com/puppetlabs/puppetlabs-sqlserver/tree/v5.0.0) - 2024-02-16

[Full Changelog](https://github.com/puppetlabs/puppetlabs-sqlserver/compare/v4.1.0...v5.0.0)
Expand Down
7 changes: 3 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ group :development do
gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
gem "facterdb", '~> 1.18', require: false
gem "metadata-json-lint", '~> 3.0', require: false
gem "metadata-json-lint", '~> 4.0', require: false
gem "puppetlabs_spec_helper", '~> 6.0', require: false
gem "rspec-puppet-facts", '~> 2.0', require: false
gem "codecov", '~> 0.2', require: false
gem "dependency_checker", '~> 1.0.0', require: false
gem "parallel_tests", '= 3.12.1', require: false
gem "pry", '~> 0.10', require: false
gem "simplecov-console", '~> 0.5', require: false
gem "simplecov-console", '~> 0.9', require: false
gem "puppet-debugger", '~> 1.0', require: false
gem "rubocop", '= 1.48.1', require: false
gem "rubocop", '~> 1.50.0', require: false
gem "rubocop-performance", '= 1.16.0', require: false
gem "rubocop-rspec", '= 2.19.0', require: false
gem "puppet-strings", '~> 4.0', require: false
Expand Down
19 changes: 0 additions & 19 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
### Functions

* [`sqlserver::partial_params_args`](#sqlserver--partial_params_args): this function populates and returns the string of arguments which later gets injected in template.
* [`sqlserver::password`](#sqlserver--password): This function exists for usage of a role password that is a deferred function
* [`sqlserver_is_domain_or_local_user`](#sqlserver_is_domain_or_local_user)
* [`sqlserver_upcase`](#sqlserver_upcase)
* [`sqlserver_validate_hash_uniq_values`](#sqlserver_validate_hash_uniq_values)
Expand Down Expand Up @@ -1236,24 +1235,6 @@ Optional[Enum['ON', 'OFF']] $nested_triggers
Optional[Enum['ON', 'OFF']] $transform_noise_words
Integer[1753, 9999] $two_digit_year_cutoff

### <a name="sqlserver--password"></a>`sqlserver::password`

Type: Ruby 4.x API

This function exists for usage of a role password that is a deferred function

#### `sqlserver::password(Optional[Any] $pass)`

This function exists for usage of a role password that is a deferred function

Returns: `Any`

##### `pass`

Data type: `Optional[Any]`



### <a name="sqlserver_is_domain_or_local_user"></a>`sqlserver_is_domain_or_local_user`

Type: Ruby 3.x API
Expand Down
13 changes: 0 additions & 13 deletions lib/puppet/functions/sqlserver/password.rb

This file was deleted.

5 changes: 4 additions & 1 deletion manifests/login.pp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@
$create_delete_login_parameters = {
'disabled' => $disabled,
'login' => $login,
'password' => Deferred('sqlserver::password', [$password]),
'password' => $password ? {
undef => undef,
default => Deferred('sprintf', [$password]),
},
'check_expiration' => $check_expiration,
'check_policy' => $check_policy,
'default_language' => $default_language,
Expand Down
5 changes: 4 additions & 1 deletion manifests/user.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@
if $create_delete == 'create' {
$create_delete_user_parameters = {
'database' => $database,
'password' => Deferred('sqlserver::password', [$password]),
'password' => $password ? {
undef => undef,
default => Deferred('sprintf', [$password]),
},
'user' => $user,
'login' => $login,
'default_schema' => $default_schema,
Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-sqlserver",
"version": "5.0.0",
"version": "5.0.1",
"author": "puppetlabs",
"summary": "The `sqlserver` module installs and manages MS SQL Server 2014, 2016, 2017, 2019 and 2022 on Windows systems.",
"license": "proprietary",
Expand Down Expand Up @@ -50,5 +50,5 @@
],
"pdk-version": "3.0.0",
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
"template-ref": "heads/main-0-g79a2f93"
"template-ref": "heads/main-0-g0f7378b"
}
8 changes: 0 additions & 8 deletions spec/functions/password_spec.rb

This file was deleted.