Commit 003448de by Paul Durivage Committed by Matt Martz

Add memory and IP information to setup

parent f423a8df
......@@ -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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment