Hi Folks,
Does anyone had an experience to use imc_rest module ? I'm trying to get information or output about hardware inventory . Say for example, I have equipmentPsu to check PSU status. however, the output is not showing when I run my playbook. is there a way to filter the attributes?
My playbook:
---
- hosts: mdhd
connection: local
gather_facts: no
vars_files:
- /etc/ansible/var.yml
tasks:
- name: validate service accounts
imc_rest:
hostname: "{{ imc_hostname }}"
username: "{{ imc_username }}"
password: "{{ imc_password }}"
protocol: https
timeout: 60
validate_certs: no
content: |
<configResolveClass inHierarchical="false" classId="equipmentPsu"/>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
output:
PLAY [mdhd] **************************************************************************************************************************************
TASK [validate PSUs] *****************************************************************************************************************
ok: [10.138.67.30]
PLAY RECAP ***************************************************************************************************************************************
10.138.67.30 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
++++++++++++++++++++++++++++++++++++++++++++++++++++
When I check -vvv , seeing the below output.
"equipmentPsu": {
"attributes": {
"dn": "sys/rack-unit-1/psu-1",
"fwVersion": "12002216",
"id": "1",
"input": "80",
"maxOutput": "NA",
"model": "700-014160-0000",
"operability": "operable",
"output": "65",
"pid": "UCSC-PSU1-770W",
"power": "on",
"presence": "equipped",
"serial": "ART2221F4WG",
"thermal": "ok",
"vendor": "Cisco Systems Inc",
"voltage": "ok"
}
}
},
{
"equipmentPsu": {
"attributes": {
"dn": "sys/rack-unit-1/psu-2",
"fwVersion": "12002216",
"id": "2",
"input": "73",
"maxOutput": "NA",
"model": "700-014160-0000",
"operability": "operable",
"output": "60",
"pid": "UCSC-PSU1-770W",
"power": "on",
"presence": "equipped",
"serial": "ART2221F4XN",
"thermal": "ok",
"vendor": "Cisco Systems Inc",
"voltage": "ok"
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thanks,
Ramesh