# How to get processeur vendor ?

**URL:** <https://forum.ansible.com/t/how-to-get-processeur-vendor/26471>\
**Category:** Ansible Project\
**Created:** [January 12, 2018, 3:50pm UTC](https://forum.ansible.com/t/how-to-get-processeur-vendor/26471 "2018-01-12T15:50:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florent\_B](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@Florent\_B](https://forum.ansible.com/u/Florent_B)\
**Post date:** [January 12, 2018, 3:50pm UTC](https://forum.ansible.com/t/how-to-get-processeur-vendor/26471/1 "2018-01-12T15:50:11Z")

</div>

Hi,

I would like to get the processor vendor of any host.

I see a lot of examples over the internet using a condition like this :

```
&#39;&quot;Intel&quot; in ansible\_processor\[0\]&#39;

```

But my "ansible\_processor[0]" variable on my hosts contains ... "0" !!

I use Ansible 2.4.2.0. When did it change ? Is it expected to work like  
this ? What about computers having single CPU ?

Thank you.

Flo

---

<div class="post-metadata">

**Author:** ![Eric\_Secrist](https://avatars.discourse-cdn.com/v4/letter/e/c68b51/32.png) [@Eric\_Secrist](https://forum.ansible.com/u/Eric_Secrist)\
**Post date:** [February 13, 2018, 9:01pm UTC](https://forum.ansible.com/t/how-to-get-processeur-vendor/26471/2 "2018-02-13T21:01:30Z")

</div>

Hi Flow,  
Did you ever get an answer to your question. I see a different number of list values for ansible\_processor between two hosts, which makes it difficult to easily gather the processor vendor across many hosts.

ok: [host1] =\> {

“hostvars[inventory\_hostname].ansible\_processor”: [

“GenuineIntel”,

“Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz”,

“GenuineIntel”,

“Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz”

]

}

ok: [host2] =\> {

“hostvars[inventory\_hostname].ansible\_processor”: [

“0”,

“GenuineIntel”,

“Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz”,

“1”,

“GenuineIntel”,

“Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz”

]

}

host2 has the extra list values of “0” and “1”.

Thanks,  
Eric

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [February 23, 2018, 4:03pm UTC](https://forum.ansible.com/t/how-to-get-processeur-vendor/26471/3 "2018-02-23T16:03:36Z")

</div>

The variable ansible\_processor, on Linux it is parsing /proc/cpuinfo line by line while looking for  
'model name', 'Processor', 'vendor\_id', 'cpu', 'Vendor', 'processor'

The first one it find become element 0 and the second becomes element 1 and so on.  
So if your /proc/cpuinfo differ you will get different result on different host.

So if you host1 and host2 is Linux it did not find processor on host1 because it does not exist in /proc/cpuinfo therefor the element 0 in the list become the vendor\_id instead since it found that first.

This make ansible\_processor unpredictable and you should probably find the information yourself.
