Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue 198 - Disable Dual Scan #225

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 8 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,14 @@
it_behaves_like 'non enabled feature'
end

context 'with disable_dual_scan =>' do
let(:reg_key) { "#{base_key}\\DisableDualScan" }
let(:param_sym) { :disable_dual_scan }

it_behaves_like 'bool value'
it_behaves_like 'non enabled feature'
end

context 'with elevate_non_admins =>' do
let(:reg_key) { "#{base_key}\\ElevateNonAdmins" }
let(:param_sym) { :elevate_non_admins }
Expand Down