Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Backport: Add exception handling to win_domain_controller (#58234) #60753
Add error handling for two exceptions.
If a user specifies a domain to join that cannot be resolved by dns, the Install-ADDSDomainController command throws an Microsoft.ADRoles.Deployment.Common.Tests.TestFailedException exception.
If the module is either invoked twice without a reboot, or a reboot is pending for another reason the Install-ADDSDomainController command throws an Microsoft.DirectoryServices.Deployment.DCPromoExecutionException exception with Errorcode 15.
I added error handling for both of them, so that a user can handle them from within the playbook.