freebsd get_dmi_facts

Hi,

I recently added two FreeBSD systems to ansible and I noticed that the system’s serial number is not included in the setup output. Upon closer investigation it seems that none of the dmi facts are.
Examining the code I saw that get_dmi_facts() is not included in the FreeBSDHardware class, however when I included it it seems that it’s working just fine provided dmidecode is installed in the system.

root@vader:~ $ ansible -m setup hap1 -a ‘filter=ansible_product*’
hap1 | success >> {
“ansible_facts”: {
“ansible_product_name”: “PowerEdge M420”,
“ansible_product_serial”: “579Y5Y1”,
“ansible_product_uuid”: “4C4C4544-0037-3910-8059-B5C04F355931”,
“ansible_product_version”: “Not Specified”
},
“changed”: false
}

Was get_dmi_facts left out of freebsd class on purpose ?
Should I send a pull request or test it further -though I don’t know how- ?

Dimos

When i was initially adding freebsd facts I left dmidecode out because it is not installed by default, I always meant to go back and add a test for it (like facter and ohai) but never got to it.

Perhaps you don’t need to.
The linux function, which I copied to freebsd, uses dmidecode only if it’s available else it just returns NA for the various dmi facts.
I guess you could have a different check and not return dmi facts at all but I’m not sure if it’s better or not.
If you plan to take a better look at it then perhaps there’s no point in me sending a pull request.

many things on my list, it will probably get done much sooner if you take a stab at it.

ok :slight_smile: