The ansible_processor field provides a list of all hyperthreaded cores. Using Jinja we can just get the number of cores on the machine by running length on this list.