From fb7ff9271aaf29343d10c0e50a4017ab07677185 Mon Sep 17 00:00:00 2001 From: Pepe Barbe Date: Mon, 6 Apr 2015 23:25:29 -0500 Subject: [PATCH] Add OS architecture and OS name to the Windows setup module --- windows/setup.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/windows/setup.ps1 b/windows/setup.ps1 index c249251d974..32b4d865263 100644 --- a/windows/setup.ps1 +++ b/windows/setup.ps1 @@ -25,6 +25,7 @@ $result = New-Object psobject @{ changed = $false }; +$win32_os = Get-WmiObject Win32_OperatingSystem $osversion = [Environment]::OSVersion $memory = @() $memory += Get-WmiObject win32_Physicalmemory @@ -53,10 +54,13 @@ foreach ($adapter in $ActiveNetcfg) Set-Attr $result.ansible_facts "ansible_interfaces" $formattednetcfg +Set-Attr $result.ansible_facts "ansible_architecture" $win32_os.OSArchitecture + Set-Attr $result.ansible_facts "ansible_hostname" $env:COMPUTERNAME; Set-Attr $result.ansible_facts "ansible_fqdn" "$([System.Net.Dns]::GetHostByName((hostname)).HostName)" Set-Attr $result.ansible_facts "ansible_system" $osversion.Platform.ToString() Set-Attr $result.ansible_facts "ansible_os_family" "Windows" +Set-Attr $result.ansible_facts "ansible_os_name" $win32_os.Name.Split('|')[0] Set-Attr $result.ansible_facts "ansible_distribution" $osversion.VersionString Set-Attr $result.ansible_facts "ansible_distribution_version" $osversion.Version.ToString()