The module hardware was not found in configured module paths

I’m using Alpine Linux 3.20.3 with Python 3.12.6 built from source. Ansible versions are ansible==9.2.0 ansible-core==2.16.3. This is my ansible.cfg: [defaults]ansible_managed = Ansible Managedcommand_warnings = false - Pastebin.com. I can see that I have the module files: ls -lah /opt/python/lib/python3.12/site-packages/ansible/module_utils/facts/hard - Pastebin.com. It works if I remove the facts_modules = hardware. I’m managing a large number of hosts via SSH so I’m trying to optimize the configuration.

Thanks,
Arthur

You should be able to reproduce with this Dockerfile: ARG TARGETARCH=amd64FROM alpine:3.20.3RUN apk add -U cmake curl file gcc g - Pastebin.com.

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.

1 Like

Thanks for the help @sivel