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

win_domain_controller fails with required parameter error #35858

Closed
ghost opened this issue Feb 7, 2018 · 5 comments · Fixed by #36017
Closed

win_domain_controller fails with required parameter error #35858

ghost opened this issue Feb 7, 2018 · 5 comments · Fixed by #36017
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team. windows Windows community

Comments

@ghost
Copy link

ghost commented Feb 7, 2018

ISSUE TYPE
  • Bug Report
COMPONENT NAME

win_domain_controller

ANSIBLE VERSION
ansible 2.5.0
  config file = /vagrant/cloudops-ansible/ansible.cfg
  configured module search path = [u'/home/vagrant/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/vagrant/.local/lib/python2.7/site-packages/ansible
  executable location = /home/vagrant/.local/bin/ansible
  python version = 2.7.12 (default, Nov 20 2017, 18:23:56) [GCC 5.4.0 20160609]
CONFIGURATION

DEFAULT_FORKS(/vagrant/cloudops-ansible/ansible.cfg) = 10

OS / ENVIRONMENT

Windows Server 2016 target

SUMMARY

The win_domain_controller module uses the Install-ADDSDomainController Powershell cmdlet. If the -ReadOnlyReplica switch is used with this cmdlet, regardless of whether it is set to true or false, the SiteName parameter is required. The way the parameters are populated causes the module to fail unless the read_only and SiteName are supplied.

STEPS TO REPRODUCE
  - win_domain_controller:
      dns_domain_name: testdomain
      domain_admin_user: user@testdomain.local
      domain_admin_password: SomePassword
      safe_mode_password: SomeOtherPassword
EXPECTED RESULTS

target windows host joins domain as a domain controller

ACTUAL RESULTS

Ansible fails with error:

fatal: [pltst-dc2]: FAILED! => {
    "attempts": 1,
    "changed": false,
    "module_stderr": "Install-ADDSDomainController : Cannot process command because of one or more missing mandatory parameters: SiteName.\r\nAt line:213 char:35\r\n+ ... ll_result = Install-ADDSDomainController -NoRebootOnCompletion -ReadO ...\r\n+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : InvalidArgument: (:) [Install-ADDSDomainController], ParentContainsErrorRecordException\r\n    + FullyQualifiedErrorId : MissingMandatoryParameter,Microsoft.DirectoryServices.Deployment.PowerShell.Commands.Ins \r\n   tallADDSDomainControllerCommand\r\n \r\n\r\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE",
    "rc": 1
}

@ansibot
Copy link
Contributor

ansibot commented Feb 7, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Feb 7, 2018

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 bug_report module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. windows Windows community labels Feb 7, 2018
@jborean93
Copy link
Contributor

Thanks @skruphy for bringing this to our attention, it should be a simple fix and I will hopefully have a PR ready soon.

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Feb 7, 2018
@jborean93
Copy link
Contributor

@skruphy are you able to test out this PR #36017 and see if it works for you?

@ghost
Copy link
Author

ghost commented Feb 12, 2018

This change successfully created an additional DC and a RODC. Thanks.

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team. windows Windows community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants