From a6d2f6fd95e091d06668218d653ea94c358a8ca6 Mon Sep 17 00:00:00 2001 From: Joe Tauke Date: Tue, 24 Apr 2018 00:35:38 -0500 Subject: [PATCH] win_domain - Add ability to specify netbios name (#39084) * Added netbios option to win_domain.ps1 and updated documentation * formatting change * formatting change * adding version added line for domain_netbios_name * Identation fix * Clarity fixes for descriptions Changes to description for netbios_domain_name and uniformity changes to other documentation sections (bringing them in line with other sections of the document). * Fix minor indentation --- lib/ansible/modules/windows/win_domain.ps1 | 6 +++++- lib/ansible/modules/windows/win_domain.py | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/windows/win_domain.ps1 b/lib/ansible/modules/windows/win_domain.ps1 index d43a8661104..d626991a5eb 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 85aac8b79ba..9de77461a8c 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: