From 003448defc2f6b9974c68788c3d91a9707866d36 Mon Sep 17 00:00:00 2001 From: Paul Durivage Date: Wed, 18 Jun 2014 12:29:14 -0500 Subject: [PATCH] Add memory and IP information to setup --- library/windows/setup.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/windows/setup.ps1 b/library/windows/setup.ps1 index 07d32c56f51..adec2d9ae0d 100644 --- a/library/windows/setup.ps1 +++ b/library/windows/setup.ps1 @@ -26,6 +26,8 @@ $result = New-Object psobject @{ }; $osversion = [Environment]::OSVersion +$memory = Get-WmiObject win32_Pysicalmemory +$netcfg = Get-WmiObject win32_NetworkAdapterConfiguration Set-Attr $result.ansible_facts "ansible_hostname" $env:COMPUTERNAME; Set-Attr $result.ansible_facts "ansible_fqdn" "$([System.Net.Dns]::GetHostByName((hostname)).HostName)" @@ -34,4 +36,10 @@ Set-Attr $result.ansible_facts "ansible_os_family" "Windows" Set-Attr $result.ansible_facts "ansible_distribution" $osversion.VersionString Set-Attr $result.ansible_facts "ansible_distribution_version" $osversion.Version.ToString() +Set-Attr $result.ansible_facts "ansible_totalmem" $memory.Capacity.ToString() + +$ips = @() +Foreach ($ip in $netcfg.IPAddress) { If ($ip) { $ips += $ip } } +Set-Attr $result.ansible_facts "ansible_ip_addresses" $ips + Exit-Json $result;