Ensures the existence of a Windows domain
- 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 :ref:`ansible.windows.win_reboot <ansible.windows.win_reboot_module>` action if changes are made.
.. seealso:: :ref:`ansible.windows.win_domain_controller_module` The official documentation on the **ansible.windows.win_domain_controller** module. :ref:`community.windows.win_domain_computer_module` The official documentation on the **community.windows.win_domain_computer** module. :ref:`community.windows.win_domain_group_module` The official documentation on the **community.windows.win_domain_group** module. :ref:`ansible.windows.win_domain_membership_module` The official documentation on the **ansible.windows.win_domain_membership** module. :ref:`community.windows.win_domain_user_module` The official documentation on the **community.windows.win_domain_user** module.
- name: Create new domain in a new forest on the target host
ansible.windows.win_domain:
dns_domain_name: ansible.vagrant
safe_mode_password: password123!
- name: Create new Windows domain in a new forest with specific parameters
ansible.windows.win_domain:
create_dns_delegation: no
database_path: C:\Windows\NTDS
dns_domain_name: ansible.vagrant
domain_mode: Win2012R2
domain_netbios_name: ANSIBLE
forest_mode: Win2012R2
safe_mode_password: password123!
sysvol_path: C:\Windows\SYSVOL
register: domain_install
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
|
- Matt Davis (@nitzmahone)