# The conditional check 'cmdb\_hwmodel.startswith('HP ')' failed

**URL:** <https://forum.ansible.com/t/the-conditional-check-cmdb-hwmodel-startswith-hp-failed/33323>\
**Category:** Ansible Project\
**Created:** [July 4, 2020, 8:15pm UTC](https://forum.ansible.com/t/the-conditional-check-cmdb-hwmodel-startswith-hp-failed/33323 "2020-07-04T20:15:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nagesh\_sheregar](https://avatars.discourse-cdn.com/v4/letter/n/3ec8ea/32.png) [@Nagesh\_sheregar](https://forum.ansible.com/u/Nagesh_sheregar)\
**Post date:** [July 4, 2020, 8:15pm UTC](https://forum.ansible.com/t/the-conditional-check-cmdb-hwmodel-startswith-hp-failed/33323/1 "2020-07-04T20:15:16Z")

</div>

can you pelase someone let me know what i am missing here:

Error:

TASK [hp : hpilo\_info] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /data01/ansible/playbooks/roles/hp/tasks/main.yml:1  
fatal: [localhost]: FAILED! =\> {  
“msg”: “The conditional check 'cmdb\_hwmodel.startswith('HP ‘)’ failed. The error was: error while evaluating conditional (cmdb\_hwmodel.startswith('HP ')): ‘cmdb\_hwmodel’ is undefined\n\nThe error appears to be in ‘/data01/ansible/playbooks/roles/hp/tasks/main.yml’: line 1, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- hpilo\_info:\n ^ here\n”  
}

Playbook:

- hpilo\_info:  
host: “{{ host }}”  
login: “{{ login }}”  
password: “{{ password }}”  
ssl\_version:  
description:
- The SSL version used to authenticate to the HP iLO interface.  
default: tlsv1  
when: cmdb\_hwmodel.startswith('HP ')  
delegate\_to: localhost  
register: results
- fail:  
msg: ‘CMDB serial ({{ cmdb\_serialno }}) does not match hardware serial ({{ results.hw\_system\_serial }}) !’  
when: cmdb\_serialno != results.hw\_system\_serial

Link:

[https://docs.ansible.com/ansible/latest/modules/hpilo\_info\_module.html#hpilo-info-module](https://docs.ansible.com/ansible/latest/modules/hpilo_info_module.html#hpilo-info-module)

---

<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:** [July 4, 2020, 9:19pm UTC](https://forum.ansible.com/t/the-conditional-check-cmdb-hwmodel-startswith-hp-failed/33323/2 "2020-07-04T21:19:06Z")

</div>

Read the error more carefully, it says exactly what is the matter

---

<div class="post-metadata">

**Author:** ![Nagesh\_sheregar](https://avatars.discourse-cdn.com/v4/letter/n/3ec8ea/32.png) [@Nagesh\_sheregar](https://forum.ansible.com/u/Nagesh_sheregar)\
**Post date:** [July 6, 2020, 6:01pm UTC](https://forum.ansible.com/t/the-conditional-check-cmdb-hwmodel-startswith-hp-failed/33323/3 "2020-07-06T18:01:19Z")

</div>

Hi Dick,

worked … I need output results like below , do we have a call back plugin for this?
