Win setup processor (#61425)

* Fix incorrect processor information

Fixes Issue #45869 
Windows Processor Information Incorrect from Setup

* set ansible_processor as list of all cores and threads (mirroring POSIX facts)

* change to $win32_cs.NumberOfLogicalProcessors to calculate $cpu_list

* Simplify vcpus count source

Co-authored-by: Jesse Kaufman <jesse.kaufman@gmail.com>
pull/61426/head
Jordan Borean 5 years ago committed by GitHub
parent 161c1ce17e
commit a95f9c6640
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -362,7 +362,7 @@ if($gather_subset.Contains('processor')) {
}
$cpu_list = @( )
for ($i=1; $i -le ($win32_cpu.NumberOfLogicalProcessors / $win32_cs.NumberOfProcessors); $i++) {
for ($i=1; $i -le $win32_cs.NumberOfLogicalProcessors; $i++) {
$cpu_list += $win32_cpu.Manufacturer
$cpu_list += $win32_cpu.Name
}
@ -371,8 +371,8 @@ if($gather_subset.Contains('processor')) {
ansible_processor = $cpu_list
ansible_processor_cores = $win32_cpu.NumberOfCores
ansible_processor_count = $win32_cs.NumberOfProcessors
ansible_processor_threads_per_core = ($win32_cpu.NumberOfLogicalProcessors / $win32_cs.NumberOfProcessors / $win32_cpu.NumberOfCores)
ansible_processor_vcpus = ($win32_cpu.NumberOfLogicalProcessors / $win32_cs.NumberOfProcessors)
ansible_processor_threads_per_core = ($win32_cpu.NumberOfLogicalProcessors / $win32_cpu.NumberofCores)
ansible_processor_vcpus = $win32_cs.NumberOfLogicalProcessors
}
}

Loading…
Cancel
Save