There is no facts module called hardware. I assume you are attempting to instruct ansible to only gather the hardware subset from setup/gather_facts?
In which case you cannot modify that via the ansible.cfg file, it must be provided within the playbook, either as gather_subset at the play level, or on an explicit fact gathering task.