From 4a59a1fc0bd0503267659ca88b0b4d1943777556 Mon Sep 17 00:00:00 2001 From: robpe49 Date: Thu, 23 May 2024 12:37:49 +0200 Subject: [PATCH] Issue 198 - Disable Dual Scan Add parameter disable_dual_scan (default undef) to be able to not allow update deferral policies to cause scans against Windows Update when using WSUS server --- manifests/init.pp | 11 +++++++++++ spec/acceptance/wsus_client_spec.rb | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 3d87816..72e0614 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -136,6 +136,10 @@ # This enabled parameter is only respected when the WSUS server allows clients to modify this setting via the TargetGroup and # TargetGroupEnabled registry keys. # +# @param disable_dual_scan +# Enable this policy to not allow update deferral policies to cause scans against Windows Update. +# Valid options: 'true', 'false', and undef. Default: undef. +# class wsus_client ( Optional[Variant[Stdlib::HTTPUrl,Boolean]] $server_url = undef, Optional[Boolean] $enable_status_server = undef, @@ -157,6 +161,7 @@ Optional[Variant[Integer[15,180],Boolean]] $always_auto_reboot_at_scheduled_time_minutes = undef, Boolean $purge_values = false, Optional[Variant[String,Boolean]] $target_group = undef, + Optional[Boolean] $disable_dual_scan = undef, ) { $_basekey = 'HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate' @@ -244,6 +249,12 @@ validate_bool => true, } + wsus_client::setting { "${_basekey}\\DisableDualScan": + data => $disable_dual_scan, + has_enabled => false, + validate_bool => true, + } + wsus_client::setting { "${_basekey}\\ElevateNonAdmins": data => $elevate_non_admins, has_enabled => false, diff --git a/spec/acceptance/wsus_client_spec.rb b/spec/acceptance/wsus_client_spec.rb index 61a10d7..5348f65 100644 --- a/spec/acceptance/wsus_client_spec.rb +++ b/spec/acceptance/wsus_client_spec.rb @@ -314,4 +314,10 @@ def create_apply_manifest(params, clear_first = true) end end end + + context 'with disable_dual_scan =>', testrail: ['70270', '70271'] do + it_behaves_like 'boolean values', + :disable_dual_scan, + 'DisableDualScan' + end end