Fix empty and zeroed memory variables on Windows (#65259)

* Fix empty and zeroed memory variables on Windows

The CIM elements about swap information are for Unix platform implementations of Powershell. CIM has separate elements for the "Windows swap".  This fixes memory information being non-present or zero.

* Properly name Windows variables for Page File

See https://github.com/ansible/ansible/pull/65259 for discussion

* Update setup.ps1
pull/65278/head
guruevi 5 years ago committed by Jordan Borean
parent 9dca2bd3c4
commit bd68bcab95

@ -315,7 +315,10 @@ if($gather_subset.Contains('memory')) {
$ansible_facts += @{
# Win32_PhysicalMemory is empty on some virtual platforms
ansible_memtotal_mb = ([math]::ceiling($win32_cs.TotalPhysicalMemory / 1024 / 1024))
ansible_memfree_mb = ([math]::ceiling($win32_os.FreePhysicalMemory / 1024))
ansible_swaptotal_mb = ([math]::round($win32_os.TotalSwapSpaceSize / 1024))
ansible_pagefiletotal_mb = ([math]::round($win32_os.SizeStoredInPagingFiles / 1024))
ansible_pagefilefree_mb = ([math]::round($win32_os.FreeSpaceInPagingFiles / 1024))
}
}

Loading…
Cancel
Save