# Ansible setup facts - system vendor on RHEL5

**URL:** <https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [March 21, 2013, 9:55am UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550 "2013-03-21T09:55:33Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edgars](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@Edgars](https://forum.ansible.com/u/Edgars)\
**Post date:** [March 21, 2013, 9:55am UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/1 "2013-03-21T09:55:33Z")

</div>

Hi

As discussed in IRC, it seems that Ansible cannot determine system vendor on RHEL5 based OS. Reason is simple: on RHEL5 there is no /sys/devices/virtual/dmi/id/ directory. Since I need that fact, I did small hack in setup module and I get this fact this way:

/usr/sbin/dmidecode -s system-product-name

AFAIK this method is compatible with all Linux distros (I checked RHEL5, RHEL6, Linux Mint). It can determine vendor be it physical or virtual (VMWare, oVirt etc).

Since this method is more general and portable, perhaps you should use this one instead of reading /sys/devices/virtual/dmi/id/sys\_vendor

Thanks  
Edgars

---

<div class="post-metadata">

**Author:** ![Lester\_Wade](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@Lester\_Wade](https://forum.ansible.com/u/Lester_Wade)\
**Post date:** [March 21, 2013, 10:00am UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/2 "2013-03-21T10:00:44Z")

</div>

I think the issue here is that it requires the dmidecode package to be installed on the host. This is probably quite unsavoury to some.

---

<div class="post-metadata">

**Author:** ![Dag\_Wieers](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dag\_Wieers](https://forum.ansible.com/u/Dag_Wieers)\
**Post date:** [March 21, 2013, 10:52am UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/3 "2013-03-21T10:52:20Z")

</div>

Discussed before on Github in the early days of the project:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[https://github.com/ansible/ansible/issues/376](https://github.com/ansible/ansible/issues/376)

There's no issue with having dmidecode for systems not having the proper sysfs entries, however it should not be implemented as the default.

---

<div class="post-metadata">

**Author:** ![Lester\_Wade](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@Lester\_Wade](https://forum.ansible.com/u/Lester_Wade)\
**Post date:** [March 21, 2013, 11:12am UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/4 "2013-03-21T11:12:42Z")

</div>

Makes sense, so this needs to be a new feature request?

---

<div class="post-metadata">

**Author:** ![Dag\_Wieers](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dag\_Wieers](https://forum.ansible.com/u/Dag_Wieers)\
**Post date:** [March 21, 2013, 12:07pm UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/5 "2013-03-21T12:07:04Z")

</div>

I think Michael prefers a support ticket ([http://www.ansibleworks.com/subscriptions/](http://www.ansibleworks.com/subscriptions/)) or a pull request ([https://github.com/ansible/ansible/pulls](https://github.com/ansible/ansible/pulls)) 🙂

I'll see if I can produce something for this, we'd like to avoid forking more than one dmidecode call. I guess python-dmidecode might be a better solution for people wanting this (on their targets). python-dmidecode is available in RHEL5.5 (or from EPEL).

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [March 21, 2013, 12:26pm UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/6 "2013-03-21T12:26:31Z")

</div>

To slightly correct dag, I \*do\* take feature requests, but there's  
obviously a bit of a backlog.

My immediate priority is bringing everyone ansible-commander, so a  
pull request that actually adds a feature is much more likely to get  
immediate traction.

It's definitely not true that you can't share an idea if you aren't  
paying us, I don't want folks thinking that 🙂

--Michael

---

<div class="post-metadata">

**Author:** ![Dag\_Wieers](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dag\_Wieers](https://forum.ansible.com/u/Dag_Wieers)\
**Post date:** [March 21, 2013, 12:30pm UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/7 "2013-03-21T12:30:54Z")

</div>

Right, I didn't wanted to imply that.

---

<div class="post-metadata">

**Author:** ![Andreas\_Piesk](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@Andreas\_Piesk](https://forum.ansible.com/u/Andreas_Piesk)\
**Post date:** [March 21, 2013, 6:08pm UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/8 "2013-03-21T18:08:37Z")

</div>

+1 for python-dmidecode. calling dmidecode and parsing the output is ugly 😉

-ap

---

<div class="post-metadata">

**Author:** ![Dag\_Wieers](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dag\_Wieers](https://forum.ansible.com/u/Dag_Wieers)\
**Post date:** [March 23, 2013, 7:10pm UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/9 "2013-03-23T19:10:04Z")

</div>

python-dmidecode implementation (for RHEL5.5+) exists at:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[https://github.com/ansible/ansible/pull/2479](https://github.com/ansible/ansible/pull/2479)

A pure dmidecode implementation has yet to be written.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [March 23, 2013, 9:15pm UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/10 "2013-03-23T21:15:03Z")

</div>

I think I'm inclined to \*not\* rely on python-dmidecode being installed  
because most people will simply not install it, and thus will be  
missing those facts.

---

<div class="post-metadata">

**Author:** ![Dag\_Wieers](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dag\_Wieers](https://forum.ansible.com/u/Dag_Wieers)\
**Post date:** [March 24, 2013, 12:24am UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/11 "2013-03-24T00:24:26Z")

</div>

Which is the same for dmidecode, which is not part of a standard/minimal install on RHEL5.

I am not sure what you mean with 'not rely', you mean you don't want to add the added complexity to the setup module ?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [March 24, 2013, 2:21am UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/12 "2013-03-24T02:21:30Z")

</div>

I mean people won't remember to install it.

Though you have a point if dmidecode itself isn't stock, it matters not so much.

---

<div class="post-metadata">

**Author:** ![Edgars](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@Edgars](https://forum.ansible.com/u/Edgars)\
**Post date:** [March 25, 2013, 2:43pm UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/13 "2013-03-25T14:43:48Z")

</div>

If we have a choice between install python-dmidecode or not to have these facts at all, then installing additional package seems reasonable requirement.

Edgars

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [March 25, 2013, 2:52pm UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/14 "2013-03-25T14:52:15Z")

</div>

yep.

---

<div class="post-metadata">

**Author:** ![Edgars](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@Edgars](https://forum.ansible.com/u/Edgars)\
**Post date:** [May 29, 2013, 11:33am UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/15 "2013-05-29T11:33:10Z")

</div>

It seems that version 1.2 still cannot determine system vendor for RHEL5, even though I have both dmidecode and python-dmidescode packages installed

Edgars

---

<div class="post-metadata">

**Author:** ![Edgars](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@Edgars](https://forum.ansible.com/u/Edgars)\
**Post date:** [May 29, 2013, 12:00pm UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/16 "2013-05-29T12:00:20Z")

</div>

so, I had to replace:

self.facts[‘system\_vendor’] = execute(‘dmidecode -s system-manufacturer’) or ‘NA’

with:

self.facts[‘system\_vendor’] = execute(‘/usr/sbin/dmidecode -s system-manufacturer’) or ‘NA’

and now it works!

Edgars

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [May 29, 2013, 12:30pm UTC](https://forum.ansible.com/t/ansible-setup-facts-system-vendor-on-rhel5/12550/17 "2013-05-29T12:30:33Z")

</div>

Ah ok, we need to make this use the find binary code in lib/ansible/module\_common.

Can you please file a ticket so we don’t forget this?

Thanks!
