Skip to content

Commit

Permalink
Issue 198 - Disable Dual Scan
Browse files Browse the repository at this point in the history
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
  • Loading branch information
brajjan committed May 23, 2024
1 parent 137be7b commit 5f825f0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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'

Expand Down Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions spec/acceptance/wsus_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5f825f0

Please sign in to comment.