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>
This commit is contained in:
Jordan Borean 2019-08-28 21:29:10 +10:00 committed by GitHub
parent 161c1ce17e
commit a95f9c6640
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}
}