# Debug with with\_items and the Task Name.

**URL:** <https://forum.ansible.com/t/debug-with-with-items-and-the-task-name/27645>\
**Category:** Ansible Project\
**Created:** [May 27, 2018, 7:02pm UTC](https://forum.ansible.com/t/debug-with-with-items-and-the-task-name/27645 "2018-05-27T19:02:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vino\_B](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@Vino\_B](https://forum.ansible.com/u/Vino_B)\
**Post date:** [May 27, 2018, 7:02pm UTC](https://forum.ansible.com/t/debug-with-with-items-and-the-task-name/27645/1 "2018-05-27T19:02:17Z")

</div>

Hi All

Request your help on where to put the debug statement

Requirement 1:  
If a package is missing the output should be like “Package {{ package name }} missing”

When debug is used the task name does not display instead the task is named as “debug”

TASK[Check the required OS Packages are installed] is not displayed when using debug  
TASK [debug] Display this as a task name

Play Book

---

<div class="post-metadata">

**Author:** ![Pranay\_Nanda](https://avatars.discourse-cdn.com/v4/letter/p/a9a28c/32.png) [@Pranay\_Nanda](https://forum.ansible.com/u/Pranay_Nanda)\
**Post date:** [May 27, 2018, 7:05pm UTC](https://forum.ansible.com/t/debug-with-with-items-and-the-task-name/27645/2 "2018-05-27T19:05:33Z")

</div>

Use package\_status.results

[https://stackoverflow.com/questions/37925282/iteration-using-with-items-and-register](https://stackoverflow.com/questions/37925282/iteration-using-with-items-and-register)

---

<div class="post-metadata">

**Author:** ![Vino\_B](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@Vino\_B](https://forum.ansible.com/u/Vino_B)\
**Post date:** [May 27, 2018, 7:38pm UTC](https://forum.ansible.com/t/debug-with-with-items-and-the-task-name/27645/3 "2018-05-27T19:38:49Z")

</div>

Hi Pranay,

if i use the package\_status.results as "as below “in my play book, and the output is as below but what we need a is clean message " Package \< pakage name\> Missing”.

**Error:**

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [we1t1te02003p]: FAILED! =\> {“msg”: “‘package\_status’ is undefined”}

**Play Book**
