* win_domain: fix issue when running without credential delegation
* Add check for reboot is required to complete role e install
* Fix changelog sanity issue
* removed meta file accidentally committed
(cherry picked from commit 008db85d44)
pull/53657/head
Jordan Borean7 years agocommitted byToshio Kuratomi
# The Netlogon service is set to auto start but is not started. This is
# required for Ansible to connect back to the host and reboot in a
# later task. Even if this fails Ansible can still connect but only
# with ansible_winrm_transport=basic so we just display a warning if
# this fails.
$iaf=$null
try{
Start-Service-NameNetlogon
}catch{
Add-Warning-obj$result-message"Failed to start the Netlogon service after promoting the host, Ansible may be unable to connect until the host is manually rebooting: $($_.Exception.Message)"
# ExitCode 15 == 'Role change is in progress or this computer needs to be restarted.'
# DCPromo exit codes details can be found at https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/deploy/troubleshooting-domain-controller-deployment
if($_.Exception.ExitCode-eq15){
$result.reboot_required=$true
}else{
Fail-Json-obj$result-message"Failed to install ADDSForest with DCPromo: $($_.Exception.Message)"
}
}
if($null-ne$iaf){
$result.reboot_required=$iaf.RebootRequired
# The Netlogon service is set to auto start but is not started. This is
# required for Ansible to connect back to the host and reboot in a
# later task. Even if this fails Ansible can still connect but only
# with ansible_winrm_transport=basic so we just display a warning if
# this fails.
try{
Start-Service-NameNetlogon
}catch{
Add-Warning-obj$result-message"Failed to start the Netlogon service after promoting the host, Ansible may be unable to connect until the host is manually rebooting: $($_.Exception.Message)"