How to fetch data from hp iLo

63 views
Skip to first unread message

NAVEEN

unread,
May 13, 2021, 11:07:43 PM5/13/21
to ansible...@googlegroups.com
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

Dick Visser

unread,
May 14, 2021, 1:28:14 AM5/14/21
to ansible...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oYsnaLHxaAdq8M4gQw6sEWopw3aJ-HOy8jqviXycVWh9g%40mail.gmail.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

NAVEEN

unread,
May 14, 2021, 3:04:35 AM5/14/21
to ansible...@googlegroups.com
Hello team,

I tried with that code.but getting below error


IMG20210514123221.jpg

Stefan Hornburg (Racke)

unread,
May 14, 2021, 3:06:30 AM5/14/21
to ansible...@googlegroups.com
On 5/14/21 9:03 AM, NAVEEN wrote:
> Hello team,
>
> I tried with that code.but getting below error
>

Please post your playbook.

Regards
Racke

>
> On Fri, May 14, 2021, 10:58 Dick Visser <dick....@geant.org <mailto:dick....@geant.org>> wrote:
>
> 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>
>
>
> On Fri, 14 May 2021 at 05:07, NAVEEN <navee...@gmail.com <mailto:navee...@gmail.com>> wrote:
>
> 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
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> <https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oYsnaLHxaAdq8M4gQw6sEWopw3aJ-HOy8jqviXycVWh9g%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> Sent from a mobile device - please excuse the brevity, spelling and
punctuation.
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwN4JrEKkf%3D-ihRb%3D_ve5gq4_1nT%3DLKPvb7C%3D_eMuAzxTg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAL8fbwN4JrEKkf%3D-ihRb%3D_ve5gq4_1nT%3DLKPvb7C%3D_eMuAzxTg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oaWBzh0EQD8HS97vq_q41PS3ULMrdX6kQ9%2BHs4pBTEHNw%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oaWBzh0EQD8HS97vq_q41PS3ULMrdX6kQ9%2BHs4pBTEHNw%40mail.gmail.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

OpenPGP_signature

NAVEEN

unread,
May 14, 2021, 3:08:01 AM5/14/21
to ansible...@googlegroups.com
IMG20210514123527.jpg

Stefan Hornburg (Racke)

unread,
May 14, 2021, 3:13:53 AM5/14/21
to ansible...@googlegroups.com
On 5/14/21 9:06 AM, NAVEEN wrote:
> 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*
> <https://docs.ansible.com/ansible/latest/collections/community/general/hpilo_info_module.html>
>
>
> On Fri, 14 May 2021 at 05:07, NAVEEN <navee...@gmail.com <mailto:navee...@gmail.com>> wrote:
>
> 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
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> <https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oYsnaLHxaAdq8M4gQw6sEWopw3aJ-HOy8jqviXycVWh9g%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> Sent from a mobile device - please excuse the brevity, spelling and
punctuation.
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwN4JrEKkf%3D-ihRb%3D_ve5gq4_1nT%3DLKPvb7C%3D_eMuAzxTg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAL8fbwN4JrEKkf%3D-ihRb%3D_ve5gq4_1nT%3DLKPvb7C%3D_eMuAzxTg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oY8cPiN77u5AUmhXZqbGZ%3D6JoA7Fr1NQZd53_3ZPQr6vA%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oY8cPiN77u5AUmhXZqbGZ%3D6JoA7Fr1NQZd53_3ZPQr6vA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
OpenPGP_signature

NAVEEN

unread,
May 14, 2021, 3:27:43 AM5/14/21
to ansible...@googlegroups.com
Code :



---
- name: Gather facts from a HP iLO interface only if the system is an HP server
  community.general.hpilo_info:
    host: wwwwwwwwwwwwwwwwww
    login: test
    password: testuser
  when: cmdb_hwmodel.startwith('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



To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4dcdaa01-e887-b05a-5305-47b0fe6ca065%40linuxia.de.


--
Regards
Naveen 

NAVEEN

unread,
May 14, 2021, 3:34:30 AM5/14/21
to ansible...@googlegroups.com
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 :
---
- name: Gather facts from a HP iLO interface only if the system is an HP server
   ^ here
--
Regards
Naveen 

Dick Visser

unread,
May 14, 2021, 3:46:28 AM5/14/21
to ansible...@googlegroups.com
The structure you have is incomplete. Tasks should go under 'tasks'.
See https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html
for some guidance.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oaFKceUWC_FP_%3DLuTMn-ARtqQ%3DsdcyihmjDkeP%2B-6K8Aw%40mail.gmail.com.



--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

NAVEEN

unread,
May 14, 2021, 4:11:56 AM5/14/21
to ansible...@googlegroups.com
Hi ,

As per ansible document only  i followed 

- 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


--
Regards
Naveen 

Dick Visser

unread,
May 14, 2021, 4:19:33 AM5/14/21
to ansible...@googlegroups.com
On Fri, 14 May 2021 at 10:11, NAVEEN <navee...@gmail.com> wrote:
>
> 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
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAB_%3D4oZ5_2-giovoK4XbiY9be2_NkgSzKaXuq%3Ddb9N6-ujxoJQ%40mail.gmail.com.

NAVEEN

unread,
May 15, 2021, 2:02:39 PM5/15/21
to ansible...@googlegroups.com
Hello ,
Finally i got some  out  ..by using the below code 

---
- hosts: localhost
vars:
iLo_IP: '0.0.0.0' #ILO IP
iLo_username: 'username' #ILO IP
iLo_password: 'password' #ILO Password
tasks:
- hpilo_facts:
host: "{{ iLo_IP }}"
login: "{{ iLo_username }}"
password: "{{ iLo_password }}"
delegate_to: localhost
## Not all return values are required, add / remove what is required
- debug: var=hw_bios_version #Ouput BIOS version
- debug: var=hw_product_name # Ouput Product Name
- debug: var=hw_bios_date # Output BIOS Date
- debug: var=hw_ethX # Output Interface Information, for each Interface
- debug: var=hw_system_serial #Output System Serial number
- debug: var=hw_eth_ilo #Output Interface Information for the ILO Network Interface
- debug: var=hw_uuid # Output Hardware UUID
- debug: var=hw_product_uuid # Output Product UUID here i want to get ILO Version ( example :ILO 5 ,ILO 4 ,ILO 3 like that) Can some one pls help me what parameter have to pass on this. thanks-- naveen



--
Regards
Naveen 
Reply all
Reply to author
Forward
0 new messages