From a1d5be00f1c54e7d2576e468612c9a5bf16bb049 Mon Sep 17 00:00:00 2001 From: ShachafGoldstein Date: Mon, 10 Jun 2019 23:51:23 +0300 Subject: [PATCH] Fixed dot stuff --- .gitignore | 1 + lib/ansible/modules/windows/setup.ps1 | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 76b764b9dfa..cff397dfd0b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ rpm-build *.iml #VSCode stuff.. .vscode/ +.favorites.json # Mac OS X stuff... .DS_Store # manpage build stuff... diff --git a/lib/ansible/modules/windows/setup.ps1 b/lib/ansible/modules/windows/setup.ps1 index 10bc8060c6a..103c447bab8 100644 --- a/lib/ansible/modules/windows/setup.ps1 +++ b/lib/ansible/modules/windows/setup.ps1 @@ -307,12 +307,9 @@ if($gather_subset.Contains('memory')) { if($gather_subset.Contains('platform')) { $win32_cs = Get-LazyCimInstance Win32_ComputerSystem $win32_os = Get-LazyCimInstance Win32_OperatingSystem - $domainSuffix = $win32_cs.Domain.Substring($win32_cs.Workgroup.length) + $domain_suffix = $win32_cs.Domain.Substring($win32_cs.Workgroup.length) - if ($domainSuffix -ne "") - {s - $domainSuffix = ".$domainSuffix" - } + $domain_suffix = ".$domain_suffix" try { $ansible_reboot_pending = Get-PendingRebootStatus @@ -323,12 +320,12 @@ if($gather_subset.Contains('platform')) { $ansible_facts += @{ ansible_architecture = $win32_os.OSArchitecture - ansible_domain = $domainSuffix - ansible_fqdn = ($win32_cs.DNSHostname + "." + $domainSuffix) + ansible_domain = $domain_suffix.Substring(1) + ansible_fqdn = ($win32_cs.DNSHostname + $domain_suffix) ansible_hostname = $win32_cs.DNSHostname ansible_netbios_name = $win32_cs.Name ansible_kernel = $osversion.Version.ToString() - ansible_nodename = ($win32_cs.DNSHostname + "." + $domainSuffix) + ansible_nodename = ($win32_cs.DNSHostname + $domain_suffix) ansible_machine_id = Get-MachineSid ansible_owner_contact = ([string] $win32_cs.PrimaryOwnerContact) ansible_owner_name = ([string] $win32_cs.PrimaryOwnerName)