Closed egorpavlikhin closed 10 months ago
I think something else is problematic here, we use InstallDns
not InstallDNS
in the code https://github.com/ansible-collections/microsoft.ad/blob/38ae305e10bf92cf50f14cce954c2012b01222d7/plugins/modules/domain.ps1#L129
I think there's something else going wrong but unfortunately I was never able to replicate this error originally. Based on the error it seems like the module is calling DCPromo
with the argument InstallDNS
itself and the error back here is an error from DCPromo
itself. We do not have any control over this as it's all internal in the module itself.
I can confirm that this is related to something in Windows Server 2019 being broken. By the looks of it the powershell commands have drifted from the underlying DCPromo
and nobody bothered to fix it. I tried to run the commands manually on a fresh machine but they still fail. Interestingly enough the command succeeds when called once but all subsequent executions fail.
https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/troubleshoot-domain-controller-deployment does give some more details, I would see if you can view some of the log files to see if they shed some more light on the situation. I had a look at what the Install-ADDSForest
cmdlet does and it calls a private API in dcpromocmd.dll
with string arguments to replicate how it would be called in the command line. This is where the cmdlet is passed in InstallDNS
but for whatever reason it is not validating it. Whether it's because the host is in some funky state or some other I'm not sure but without being able to replicate my hands are somewhat tied.
Hopefully the error logs might indicate what might be going wrong here or at least point us in a different direction.
SUMMARY
microsoft.ad.domain
task always fails with the errorThe specified argument 'InstallDNS' was not recognized.
It seems that this issue has been fixed years back but somehow came back?InstallDNS
is supposed to be with lowercaseInstallDns
. I checked the source file and it seems to be correct but somehow it still fails.COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Controller: Ubuntu 22 Target: Windows Server 2019
STEPS TO REPRODUCE
EXPECTED RESULTS
Expect the task to run and save the result
ACTUAL RESULTS
ISSUE TYPE
COMPONENT NAME
microsoft.ad.domain
ANSIBLE VERSION