From f8f81cbadb6d2f7a3f83c3600d60eb4a8620dc36 Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 20 Apr 2022 11:07:49 +0100 Subject: [PATCH 1/3] (maint) PDK Update --- .github/workflows/nightly.yml | 2 +- metadata.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c8fe88a..42816e7 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -200,5 +200,5 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }} # Optional Input - channel: '#team-ia-bots' + channel: '#team-cat-bots' name: 'GABot' diff --git a/metadata.json b/metadata.json index 2d09a24..409d259 100644 --- a/metadata.json +++ b/metadata.json @@ -36,5 +36,5 @@ "description": "This module provides a native type and provider to manage keys and values in the Windows Registry", "pdk-version": "2.3.0", "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-gf3911d3" + "template-ref": "heads/main-0-g806810b" } From 6e9e4e468597842be4773cedd07bd98b4adb85d7 Mon Sep 17 00:00:00 2001 From: david22swan Date: Tue, 26 Apr 2022 11:05:06 +0100 Subject: [PATCH 2/3] (GH-cat-9) syntax:hiera:yaml fixes --- examples/compliance_example.pp | 4 ++-- examples/purge_example.pp | 2 +- examples/registry_examples.pp | 6 +++--- examples/service_example.pp | 6 ++---- manifests/service.pp | 3 +-- manifests/value.pp | 15 +++++++-------- 6 files changed, 16 insertions(+), 20 deletions(-) diff --git a/examples/compliance_example.pp b/examples/compliance_example.pp index 3623112..c85fa1e 100644 --- a/examples/compliance_example.pp +++ b/examples/compliance_example.pp @@ -28,7 +28,7 @@ notify { 'compliance_example_mode_info': message => 'Switch to audit mode using \$env:FACTER_REGISTRY_COMPLIANCE_EXAMPLE_MODE = \'audit\'', - before => Notify['compliance_example_mode'] + before => Notify['compliance_example_mode'], } } } @@ -41,7 +41,7 @@ Registry_key { ensure => $mode ? { setup => present, - default => undef + default => undef, }, purge_values => $mode ? { setup => true, diff --git a/examples/purge_example.pp b/examples/purge_example.pp index ef7ed30..8ec2a96 100644 --- a/examples/purge_example.pp +++ b/examples/purge_example.pp @@ -73,7 +73,7 @@ registry_value { "${key_path}\\Value4": ensure => present, type => array, - data => [ 'one', 'two', 'three' ], + data => ['one', 'two', 'three'], } registry_value { "${key_path}\\Value5": ensure => present, diff --git a/examples/registry_examples.pp b/examples/registry_examples.pp index ca253f2..e01138a 100644 --- a/examples/registry_examples.pp +++ b/examples/registry_examples.pp @@ -67,17 +67,17 @@ registry_value { 'HKLM\Software\Vendor\Bar\valuearray1': ensure => present, type => array, - data => [ 'one', 'two', 'three' ], + data => ['one', 'two', 'three'], } $some_string = 'somestring' registry_value { 'HKLM\Software\Vendor\Bar\valuearray2': ensure => present, type => array, - data => [ 0, 'zero', '0', 123456, 'two', $some_string ], + data => [0, 'zero', '0', 123456, 'two', $some_string], } -$some_array = [ 'array1', 'array2', 'array3' ] +$some_array = ['array1', 'array2', 'array3'] registry_value { 'HKLM\Software\Vendor\Bar\valuearray3': ensure => present, type => array, diff --git a/examples/service_example.pp b/examples/service_example.pp index d695819..e6a4a72 100644 --- a/examples/service_example.pp +++ b/examples/service_example.pp @@ -20,16 +20,14 @@ # Define a new service named "Puppet Test" that is disabled. registry::service { 'PuppetExample1': display_name => 'Puppet Example 1', - description => - 'This is a simple example managing the + description => 'This is a simple example managing the registry entries for a Windows Service', command => 'C:\PuppetExample1.bat', start => 'disabled', } registry::service { 'PuppetExample2': display_name => 'Puppet Example 2', - description => - 'This is a simple example + description => 'This is a simple example managing the registry entries for a Windows Service', command => 'C:\PuppetExample2.bat', start => 'disabled', diff --git a/manifests/service.pp b/manifests/service.pp index 88d8472..8616fe7 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -32,14 +32,13 @@ # command => 'C:\PuppetLabs\Puppet\service\daemon.bat', # } # -define registry::service( +define registry::service ( $ensure = 'UNSET', $display_name = 'UNSET', $description = 'UNSET', $command = 'UNSET', $start = 'UNSET' ) { - $ensure_real = $ensure ? { 'UNSET' => present, undef => present, diff --git a/manifests/value.pp b/manifests/value.pp index fc8683f..efb8c6a 100644 --- a/manifests/value.pp +++ b/manifests/value.pp @@ -37,16 +37,15 @@ # } # define registry::value ( - Pattern[/^\w+/] $key, - Optional[String] $value = undef, - Optional[Pattern[/^\w+/]] $type = 'string', + Pattern[/^\w+/] $key, + Optional[String] $value = undef, + Pattern[/^\w+/] $type = 'string', Optional[Variant[ - String, - Numeric, - Array[String] - ]] $data = undef, + String, + Numeric, + Array[String] + ]] $data = undef, ) { - # ensure windows os if $::operatingsystem != 'windows' { fail("Unsupported OS ${::operatingsystem}") From 0442cdcb9a4877404957f2c415666b65b054e685 Mon Sep 17 00:00:00 2001 From: david22swan Date: Tue, 26 Apr 2022 11:05:14 +0100 Subject: [PATCH 3/3] (GH-cat-9) syntax:hiera:yaml exclusions added --- .puppet-lint.rc | 7 +++++++ .sync.yml | 9 +++++++++ Rakefile | 7 +++++++ metadata.json | 4 ++-- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.puppet-lint.rc b/.puppet-lint.rc index cc96ece..7ba4a14 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1 +1,8 @@ --relative +--no-parameter_types-check +--no-parameter_documentation-check +--no-top_scope_facts-check +--no-legacy_facts-check +--no-relative_classname_inclusion-check +--no-unquoted_string_in_selector-check +--no-unquoted_string_in_case-check diff --git a/.sync.yml b/.sync.yml index 0fed9e7..4af5289 100644 --- a/.sync.yml +++ b/.sync.yml @@ -27,3 +27,12 @@ spec/spec_helper.rb: unmanaged: false .travis.yml: delete: true +Rakefile: + extra_disabled_lint_checks: + - parameter_types + - parameter_documentation + - top_scope_facts + - legacy_facts + - relative_classname_inclusion + - unquoted_string_in_selector + - unquoted_string_in_case diff --git a/Rakefile b/Rakefile index 0f8754e..710df2e 100644 --- a/Rakefile +++ b/Rakefile @@ -42,6 +42,13 @@ def changelog_future_release end PuppetLint.configuration.send('disable_relative') +PuppetLint.configuration.send('disable_parameter_types') +PuppetLint.configuration.send('disable_parameter_documentation') +PuppetLint.configuration.send('disable_top_scope_facts') +PuppetLint.configuration.send('disable_legacy_facts') +PuppetLint.configuration.send('disable_relative_classname_inclusion') +PuppetLint.configuration.send('disable_unquoted_string_in_selector') +PuppetLint.configuration.send('disable_unquoted_string_in_case') if Bundler.rubygems.find_name('github_changelog_generator').any? diff --git a/metadata.json b/metadata.json index 409d259..de786ed 100644 --- a/metadata.json +++ b/metadata.json @@ -34,7 +34,7 @@ } ], "description": "This module provides a native type and provider to manage keys and values in the Windows Registry", - "pdk-version": "2.3.0", + "pdk-version": "2.4.0", "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g806810b" + "template-ref": "2.5.0-0-g806810b" }