diff --git a/lib/ansible/modules/windows/win_domain.ps1 b/lib/ansible/modules/windows/win_domain.ps1 index d43a866110..d626991a5e 100644 --- a/lib/ansible/modules/windows/win_domain.ps1 +++ b/lib/ansible/modules/windows/win_domain.ps1 @@ -38,6 +38,7 @@ Function Ensure-Prereqs { $parsed_args = Parse-Args $args -supports_check_mode $true $check_mode = Get-AnsibleParam $parsed_args "_ansible_check_mode" -default $false $dns_domain_name = Get-AnsibleParam $parsed_args "dns_domain_name" -failifempty $true +$domain_netbios_name = Get-AnsibleParam $parsed_args "domain_netbios_name" $safe_mode_admin_password = Get-AnsibleParam $parsed_args "safe_mode_password" -failifempty $true $database_path = Get-AnsibleParam $parsed_args "database_path" -type "path" $sysvol_path = Get-AnsibleParam $parsed_args "sysvol_path" -type "path" @@ -80,7 +81,10 @@ If(-not $forest) { if ($sysvol_path) { $install_forest_args.SysvolPath = $sysvol_path } - + if ($domain_netbios_name) { + $install_forest_args.DomainNetBiosName = $domain_netbios_name + } + $iaf = Install-ADDSForest @install_forest_args $result.reboot_required = $iaf.RebootRequired diff --git a/lib/ansible/modules/windows/win_domain.py b/lib/ansible/modules/windows/win_domain.py index 85aac8b79b..9de77461a8 100644 --- a/lib/ansible/modules/windows/win_domain.py +++ b/lib/ansible/modules/windows/win_domain.py @@ -19,11 +19,16 @@ description: options: dns_domain_name: description: - - the DNS name of the domain which should exist and be reachable or reside on the target Windows host + - The DNS name of the domain which should exist and be reachable or reside on the target Windows host. required: yes + domain_netbios_name: + description: + - 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. + version_added: '2.6' safe_mode_password: description: - - safe mode password for the domain controller + - Safe mode password for the domain controller. required: yes database_path: description: