# How to fetch data from hp iLo

**URL:** <https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168>\
**Category:** Ansible Project\
**Created:** [May 14, 2021, 3:07am UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168 "2021-05-14T03:07:19Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![NAVEEN](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@NAVEEN](https://forum.ansible.com/u/NAVEEN)\
**Post date:** [May 14, 2021, 3:07am UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168/1 "2021-05-14T03:07:19Z")

</div>

Hello guys,

I want to display hp ilo version ,bios version bios date raid version… by using ANSIBLE code .can some one pls help me to achive that.

I am new to ansible so pls help me out

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [May 14, 2021, 5:27am UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168/2 "2021-05-14T05:27:50Z")

</div>

[https://docs.ansible.com/ansible/latest/collections/community/general/hpilo\_info\_module.html](https://docs.ansible.com/ansible/latest/collections/community/general/hpilo_info_module.html)

---

<div class="post-metadata">

**Author:** ![NAVEEN](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@NAVEEN](https://forum.ansible.com/u/NAVEEN)\
**Post date:** [May 14, 2021, 7:03am UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168/3 "2021-05-14T07:03:35Z")

</div>

Hello team,

I tried with that code.but getting below error

> **(attachments)**
>
> ![IMG20210514123221.jpg](https://us1.discourse-cdn.com/ansible/original/2X/1/18efe0bf82a33d4bd7b798de95b4ba2f6b5c3fc5.jpeg)

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [May 14, 2021, 7:06am UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168/4 "2021-05-14T07:06:08Z")

</div>

> Hello team,
> 
> I tried with that code.but getting below error

Please post your playbook.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

> &nbsp;&nbsp;&nbsp;&nbsp;[https://docs.ansible.com/ansible/latest/collections/community/general/hpilo\_info\_module.html](https://docs.ansible.com/ansible/latest/collections/community/general/hpilo_info_module.html)  
> &nbsp;&nbsp;&nbsp;&nbsp;\<[https://docs.ansible.com/ansible/latest/collections/community/general/hpilo\_info\_module.html&gt](https://docs.ansible.com/ansible/latest/collections/community/general/hpilo_info_module.html&gt);
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hello guys,
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I want to display hp ilo version ,bios version bios date raid version.. by using ANSIBLE code .can some one pls  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;help me to achive that.
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I am new to ansible so pls help me out
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You received this message because you are subscribed to the Google Groups "Ansible Project" group.  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To unsubscribe from this group and stop receiving emails from it, send an email to  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ansible-project+unsubscribe@googlegroups.com \<mailto:ansible-project+unsubscribe@googlegroups.com\>.  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To view this discussion on the web visit  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[https://groups.google.com/d/msgid/ansible-project/CAB\_%3D4oYsnaLHxaAdq8M4gQw6sEWopw3aJ-HOy8jqviXycVWh9g%40mail.gmail.com](https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oYsnaLHxaAdq8M4gQw6sEWopw3aJ-HOy8jqviXycVWh9g%40mail.gmail.com)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<[https://groups.google.com/d/msgid/ansible-project/CAB\_%3D4oYsnaLHxaAdq8M4gQw6sEWopw3aJ-HOy8jqviXycVWh9g%40mail.gmail.com?utm\_medium=email&utm\_source=footer&gt;\](https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oYsnaLHxaAdq8M4gQw6sEWopw3aJ-HOy8jqviXycVWh9g%40mail.gmail.com?utm_medium=email&utm_source=footer&gt;%5C).
> 
> &nbsp;&nbsp;&nbsp;&nbsp;--  
> &nbsp;&nbsp;&nbsp;&nbsp;Sent from a mobile device - please excuse the brevity, spelling and

punctuation.

---

<div class="post-metadata">

**Author:** ![NAVEEN](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@NAVEEN](https://forum.ansible.com/u/NAVEEN)\
**Post date:** [May 14, 2021, 7:06am UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168/5 "2021-05-14T07:06:17Z")

</div>

Written code below screenshot

> **(attachments)**
>
> ![IMG20210514123527.jpg](https://us1.discourse-cdn.com/ansible/original/2X/e/ed77447c0f36b202ad17f3cb0546ef6250cee52e.jpeg)

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [May 14, 2021, 7:13am UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168/6 "2021-05-14T07:13:31Z")

</div>

> Written code below screenshot

You have a typo in delegate\_to:

Otherwise please post playbooks and error messages in the mail and \*not as screenshot\*

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

> &nbsp;&nbsp;&nbsp;&nbsp;[https://docs.ansible.com/ansible/latest/collections/community/general/hpilo\_info\_module.html](https://docs.ansible.com/ansible/latest/collections/community/general/hpilo_info_module.html)  
> &nbsp;&nbsp;&nbsp;&nbsp;\<[https://docs.ansible.com/ansible/latest/collections/community/general/hpilo\_info\_module.html&gt](https://docs.ansible.com/ansible/latest/collections/community/general/hpilo_info_module.html&gt);
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hello guys,
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I want to display hp ilo version ,bios version bios date raid version.. by using ANSIBLE code .can some one pls  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;help me to achive that.
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I am new to ansible so pls help me out
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You received this message because you are subscribed to the Google Groups "Ansible Project" group.  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To unsubscribe from this group and stop receiving emails from it, send an email to  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ansible-project+unsubscribe@googlegroups.com \<mailto:ansible-project+unsubscribe@googlegroups.com\>.  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To view this discussion on the web visit  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[https://groups.google.com/d/msgid/ansible-project/CAB\_%3D4oYsnaLHxaAdq8M4gQw6sEWopw3aJ-HOy8jqviXycVWh9g%40mail.gmail.com](https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oYsnaLHxaAdq8M4gQw6sEWopw3aJ-HOy8jqviXycVWh9g%40mail.gmail.com)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<[https://groups.google.com/d/msgid/ansible-project/CAB\_%3D4oYsnaLHxaAdq8M4gQw6sEWopw3aJ-HOy8jqviXycVWh9g%40mail.gmail.com?utm\_medium=email&utm\_source=footer&gt;\](https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oYsnaLHxaAdq8M4gQw6sEWopw3aJ-HOy8jqviXycVWh9g%40mail.gmail.com?utm_medium=email&utm_source=footer&gt;%5C).
> 
> &nbsp;&nbsp;&nbsp;&nbsp;--  
> &nbsp;&nbsp;&nbsp;&nbsp;Sent from a mobile device - please excuse the brevity, spelling and

punctuation.

---

<div class="post-metadata">

**Author:** ![NAVEEN](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@NAVEEN](https://forum.ansible.com/u/NAVEEN)\
**Post date:** [May 14, 2021, 7:27am UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168/7 "2021-05-14T07:27:21Z")

</div>

Code :

---

<div class="post-metadata">

**Author:** ![NAVEEN](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@NAVEEN](https://forum.ansible.com/u/NAVEEN)\
**Post date:** [May 14, 2021, 7:34am UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168/8 "2021-05-14T07:34:03Z")

</div>

Error :

ERROR ! ‘community.general.hpilo\_info’ is not a valid attribute for a play

The error appears to be in ‘/home/kondurun/projects/ansible/playbokks/ilo-module.yml’ : line 2,column 3,but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be :

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [May 14, 2021, 7:46am UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168/9 "2021-05-14T07:46:01Z")

</div>

The structure you have is incomplete. Tasks should go under 'tasks'.  
See [https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_intro.html](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html)  
for some guidance.

---

<div class="post-metadata">

**Author:** ![NAVEEN](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@NAVEEN](https://forum.ansible.com/u/NAVEEN)\
**Post date:** [May 14, 2021, 8:11am UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168/10 "2021-05-14T08:11:30Z")

</div>

Hi ,

As per ansible document only i followed

```auto
- name: Gather facts from a HP iLO interface only if the system is an HP server
  community.general.hpilo_info:
    host: YOUR_ILO_ADDRESS
    login: YOUR_ILO_LOGIN
    password: YOUR_ILO_PASSWORD
  when: cmdb_hwmodel.startswith('HP ')
  delegate_to: localhost
  register: results

- ansible.builtin.fail:
    msg: 'CMDB serial ({{ cmdb_serialno }}) does not match hardware serial ({{ results.hw_system_serial }}) !'
  when: cmdb_serialno != results.hw_system_serial

```

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [May 14, 2021, 8:19am UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168/11 "2021-05-14T08:19:10Z")

</div>

> Hi ,
> 
> As per ansible document only i followed

I don't know which document you are referring to. But not every  
document has \*full\* examples.  
Start at the beginning, using the link I posted earlier.  
Just to make sure you get the right link, this is it:  
[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_intro.html](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html)

---

<div class="post-metadata">

**Author:** ![NAVEEN](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@NAVEEN](https://forum.ansible.com/u/NAVEEN)\
**Post date:** [May 15, 2021, 6:02pm UTC](https://forum.ansible.com/t/how-to-fetch-data-from-hp-ilo/35168/12 "2021-05-15T18:02:18Z")

</div>

Hello ,  
Finally i got some out …by using the below code

| |
