diff --git a/lib/ansible/module_utils/facts/hardware/linux.py b/lib/ansible/module_utils/facts/hardware/linux.py index 95b03355d34..eb1d0fc914a 100644 --- a/lib/ansible/module_utils/facts/hardware/linux.py +++ b/lib/ansible/module_utils/facts/hardware/linux.py @@ -193,6 +193,7 @@ class LinuxHardware(Hardware): # model name is for Intel arch, Processor (mind the uppercase P) # works for some ARM devices, like the Sheevaplug. + # 'ncpus active' is SPARC attribute if key in ['model name', 'Processor', 'vendor_id', 'cpu', 'Vendor', 'processor']: if 'processor' not in cpu_facts: cpu_facts['processor'] = [] @@ -216,6 +217,8 @@ class LinuxHardware(Hardware): cores[coreid] = int(data[1].strip()) elif key == '# processors': cpu_facts['processor_cores'] = int(data[1].strip()) + elif key == 'ncpus active': + i = int(data[1].strip()) # Skip for platforms without vendor_id/model_name in cpuinfo (e.g ppc64le) if vendor_id_occurrence > 0: