diff --git a/lib/ansible/modules/windows/win_domain.ps1 b/lib/ansible/modules/windows/win_domain.ps1 index a65dbd2b143..67a5478d522 100644 --- a/lib/ansible/modules/windows/win_domain.ps1 +++ b/lib/ansible/modules/windows/win_domain.ps1 @@ -16,6 +16,7 @@ Function Ensure-Prereqs { # NOTE: AD-Domain-Services includes: RSAT-AD-AdminCenter, RSAT-AD-Powershell and RSAT-ADDS-Tools $awf = Add-WindowsFeature AD-Domain-Services -WhatIf:$check_mode + $result.reboot_required = $awf.RestartNeeded # FUTURE: Check if reboot necessary return $true } diff --git a/lib/ansible/modules/windows/win_domain_controller.ps1 b/lib/ansible/modules/windows/win_domain_controller.ps1 index 4fa8c48b6b0..fc32c86d766 100644 --- a/lib/ansible/modules/windows/win_domain_controller.ps1 +++ b/lib/ansible/modules/windows/win_domain_controller.ps1 @@ -50,7 +50,8 @@ Function Ensure-FeatureInstallation { Write-DebugLog "Ensuring required Windows features are installed..." $feature_result = Install-WindowsFeature $required_features - + $result.reboot_required = $feature_result.RestartNeeded + If(-not $feature_result.Success) { Exit-Json -message ("Error installing AD-Domain-Services and RSAT-ADDS features: {0}" -f ($feature_result | Out-String)) } diff --git a/test/sanity/pslint/ignore.txt b/test/sanity/pslint/ignore.txt index 3cf064d8412..44649ab595e 100644 --- a/test/sanity/pslint/ignore.txt +++ b/test/sanity/pslint/ignore.txt @@ -48,7 +48,6 @@ lib/ansible/modules/windows/win_dns_client.ps1 PSUseApprovedVerbs lib/ansible/modules/windows/win_dns_client.ps1 PSUseDeclaredVarsMoreThanAssignments lib/ansible/modules/windows/win_domain.ps1 PSAvoidUsingEmptyCatchBlock lib/ansible/modules/windows/win_domain.ps1 PSUseApprovedVerbs -lib/ansible/modules/windows/win_domain.ps1 PSUseDeclaredVarsMoreThanAssignments lib/ansible/modules/windows/win_domain_controller.ps1 PSAvoidGlobalVars lib/ansible/modules/windows/win_domain_controller.ps1 PSAvoidTrailingWhitespace lib/ansible/modules/windows/win_domain_controller.ps1 PSAvoidUsingWMICmdlet