mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix facts memtotal_mb rounding on VMWare and swaptotal_mb conversion from KB to MB (#49940)
This commit is contained in:
parent
2fb9b46752
commit
f461025dbb
1 changed files with 2 additions and 2 deletions
|
@ -298,8 +298,8 @@ if($gather_subset.Contains('memory')) {
|
||||||
$win32_os = Get-LazyCimInstance Win32_OperatingSystem
|
$win32_os = Get-LazyCimInstance Win32_OperatingSystem
|
||||||
$ansible_facts += @{
|
$ansible_facts += @{
|
||||||
# Win32_PhysicalMemory is empty on some virtual platforms
|
# Win32_PhysicalMemory is empty on some virtual platforms
|
||||||
ansible_memtotal_mb = ([math]::round($win32_cs.TotalPhysicalMemory / 1024 / 1024))
|
ansible_memtotal_mb = ([math]::ceiling($win32_cs.TotalPhysicalMemory / 1024 / 1024))
|
||||||
ansible_swaptotal_mb = ([math]::round($win32_os.TotalSwapSpaceSize / 1024 / 1024))
|
ansible_swaptotal_mb = ([math]::round($win32_os.TotalSwapSpaceSize / 1024))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue