fix facts memtotal_mb rounding on VMWare and swaptotal_mb conversion from KB to MB

This commit is contained in:
Gregory Storme 2018-12-14 13:30:19 +01:00
parent 013c42b14f
commit cc3e43cb20

View file

@ -298,8 +298,8 @@ if($gather_subset.Contains('memory')) {
$win32_os = Get-LazyCimInstance Win32_OperatingSystem
$ansible_facts += @{
# Win32_PhysicalMemory is empty on some virtual platforms
ansible_memtotal_mb = ([math]::round($win32_cs.TotalPhysicalMemory / 1024 / 1024))
ansible_swaptotal_mb = ([math]::round($win32_os.TotalSwapSpaceSize / 1024 / 1024))
ansible_memtotal_mb = ([math]::ceiling($win32_cs.TotalPhysicalMemory / 1024 / 1024))
ansible_swaptotal_mb = ([math]::round($win32_os.TotalSwapSpaceSize / 1024))
}
}