# freebsd get\_dmi\_facts

**URL:** <https://forum.ansible.com/t/freebsd-get-dmi-facts/14092>\
**Category:** Ansible Project\
**Created:** [December 6, 2013, 7:52pm UTC](https://forum.ansible.com/t/freebsd-get-dmi-facts/14092 "2013-12-06T19:52:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimos\_Alevizos](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@Dimos\_Alevizos](https://forum.ansible.com/u/Dimos_Alevizos)\
**Post date:** [December 6, 2013, 7:52pm UTC](https://forum.ansible.com/t/freebsd-get-dmi-facts/14092/1 "2013-12-06T19:52:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [December 6, 2013, 8:00pm UTC](https://forum.ansible.com/t/freebsd-get-dmi-facts/14092/2 "2013-12-06T20:00:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Dimos\_Alevizos](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@Dimos\_Alevizos](https://forum.ansible.com/u/Dimos_Alevizos)\
**Post date:** [December 6, 2013, 10:44pm UTC](https://forum.ansible.com/t/freebsd-get-dmi-facts/14092/3 "2013-12-06T22:44:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [December 6, 2013, 11:01pm UTC](https://forum.ansible.com/t/freebsd-get-dmi-facts/14092/4 "2013-12-06T23:01:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dimos\_Alevizos](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@Dimos\_Alevizos](https://forum.ansible.com/u/Dimos_Alevizos)\
**Post date:** [December 6, 2013, 11:12pm UTC](https://forum.ansible.com/t/freebsd-get-dmi-facts/14092/5 "2013-12-06T23:12:11Z")

</div>

ok 🙂
