homelab/orchestration/ansible/roles/inventory-cli
Dan V 29440b68a9 fix: sudo dmidecode fallback when running without root
Without root, dmidecode exits 0 but outputs only a header comment
with no Handle blocks (DMI tables are root-only in sysfs).
The previous empty-string check never triggered the sudo retry.

Now checks for the presence of 'Handle ' lines: if absent, retries
transparently with sudo. Users with passwordless sudo get full hardware
detail (CPU slots, memory sticks/slots, cache, voltage) without needing
to explicitly invoke sudo themselves.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-06 23:45:35 +02:00
..
files fix: sudo dmidecode fallback when running without root 2026-04-06 23:45:35 +02:00