On this page
win_domain – Ensures the existence of a Windows domain
New in version 2.3.
Synopsis
- Ensure that the domain named by
dns_domain_name
exists and is reachable. - If the domain is not reachable, the domain is created in a new forest on the target Windows Server 2012R2+ host.
- This module may require subsequent use of the win_reboot action if changes are made.
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
database_path
path
added in 2.5
|
The path to a directory on a fixed disk of the Windows host where the domain database will be created.
If not set then the default path is %SYSTEMROOT%\NTDS .
|
|
dns_domain_name
- / required
|
The DNS name of the domain which should exist and be reachable or reside on the target Windows host.
|
|
domain_netbios_name
-
added in 2.6
|
The netbios name of the domain.
If not set, then the default netbios name will be the first section of dns_domain_name, up to, but not including the first period.
|
|
safe_mode_password
- / required
|
Safe mode password for the domain controller.
|
|
sysvol_path
path
added in 2.5
|
The path to a directory on a fixed disk of the Windows host where the Sysvol file will be created.
If not set then the default path is %SYSTEMROOT%\SYSVOL .
|
Examples
- name: Ensure the named domain is reachable from the target host; if not, create the domain in a new forest residing on the target host
win_domain:
dns_domain_name: ansible.vagrant
safe_mode_password: password123!
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
reboot_required
boolean
|
always |
True if changes were made that require a reboot.
Sample:
True
|
Status
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Core Team. [core]
Red Hat Support
More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.
Authors
- Matt Davis (@nitzmahone)
Hint
If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.7/modules/win_domain_module.html