From f461025dbb9ce385f4152af73be7845c7865b1a5 Mon Sep 17 00:00:00 2001 From: Gregory Storme Date: Mon, 17 Dec 2018 23:09:19 +0100 Subject: [PATCH] fix facts memtotal_mb rounding on VMWare and swaptotal_mb conversion from KB to MB (#49940) --- lib/ansible/modules/windows/setup.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/windows/setup.ps1 b/lib/ansible/modules/windows/setup.ps1 index e81d328b787..4aaba019901 100644 --- a/lib/ansible/modules/windows/setup.ps1 +++ b/lib/ansible/modules/windows/setup.ps1 @@ -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)) } }