# Playbook skips the debug for no reason

**URL:** <https://forum.ansible.com/t/playbook-skips-the-debug-for-no-reason/37354>\
**Category:** Ansible Project\
**Created:** [November 15, 2022, 7:04pm UTC](https://forum.ansible.com/t/playbook-skips-the-debug-for-no-reason/37354 "2022-11-15T19:04:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Veera](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/veera/32/4107_2.png) [@Veera](https://forum.ansible.com/u/Veera)\
**Post date:** [November 15, 2022, 7:04pm UTC](https://forum.ansible.com/t/playbook-skips-the-debug-for-no-reason/37354/1 "2022-11-15T19:04:15Z")

</div>

Hi,

I am not sure why the playbook skips the debug to print the output.  
Am i missing some thing ?

- name: Collect the JDK version of the updated package  
shell: “/apps/jdk1.8.0\_351/bin/java -version”  
register: jdkstat

- debug:  
var: jdkstat.stdout  
verbosity: 2

However the log shows the logs are registered under jdkstat.err .

changed: [server1] =\> {  
“changed”: true,  
“cmd”: “/apps/jdk1.8.0\_351/bin/java -version”,  
“delta”: “0:00:00.066018”,  
“end”: “2022-11-15 12:45:45.676558”,  
“invocation”: {  
“module\_args”: {  
“\_raw\_params”: “/apps/jdk1.8.0\_351/bin/java -version”,  
“\_uses\_shell”: true,  
“argv”: null,  
“chdir”: null,  
“creates”: null,  
“executable”: null,  
“removes”: null,  
“stdin”: null,  
“stdin\_add\_newline”: true,  
“strip\_empty\_ends”: true,  
“warn”: true  
}  
},  
“rc”: 0,  
“start”: “2022-11-15 12:45:45.610540”,  
“stderr”: “java version "1.8.0\_351"\nJava™ SE Runtime Environment (build 1.8.0\_351-b10)\nJava HotSpot™ 64-Bit Server VM (build 25.351-b10, mixed mode)”,  
“stderr\_lines”: [  
“java version "1.8.0\_351"”,  
“Java™ SE Runtime Environment (build 1.8.0\_351-b10)”,  
“Java HotSpot™ 64-Bit Server VM (build 25.351-b10, mixed mode)”  
],  
“stdout”: “”,  
“stdout\_lines”:   
}

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/veera/myplay.yml:34  
skipping: [server1] =\> {  
“skipped\_reason”: “Verbosity threshold not met.”

Even i change the debug module content to below:, still no output in debug

- debug:  
var: jdkstat.err  
verbosity: 2

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [November 15, 2022, 7:36pm UTC](https://forum.ansible.com/t/playbook-skips-the-debug-for-no-reason/37354/2 "2022-11-15T19:36:04Z")

</div>

Debug looks like it is indented too far? Needs to properly line up.

> - name: Collect the JDK version of the updated package  
> shell: “/apps/jdk1.8.0\_351/bin/java -version”  
> register: jdkstat
> 
> - debug:  
> var: jdkstat.stdout  
> verbosity: 2

Walter

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [November 15, 2022, 7:54pm UTC](https://forum.ansible.com/t/playbook-skips-the-debug-for-no-reason/37354/3 "2022-11-15T19:54:14Z")

</div>

I think you misunderstand what the “ **verbosity: 2** ” does on a ansible.builtin.debug task:

> **verbosity**
> 
> integer
> 
> added in 2.1 of ansible.builtin
> 
> A number that controls when the debug is run, if you set to 3 it will only run debug when -vvv or above.
> 
> Default: 0

If you run ansible-playbook with only zero or one "-v"s, then that step will be silently skipped.

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [November 15, 2022, 8:10pm UTC](https://forum.ansible.com/t/playbook-skips-the-debug-for-no-reason/37354/4 "2022-11-15T20:10:18Z")

</div>

Hate to be “that guy,” but it is incredibly annoying how terrible the Google Groups interface is for communicating technical info, especially where indentation actually matters. I’ve tried the web interface and various plugins for markdown formatting in email, only to be rudely surprised by the results: weird indentation, crazy highlighting, spurious blank lines, hit-n-miss fixed-width vs “creative” font interpretations… I have my own private google group _just for formatting experiments_ for posts destined eventually to this group, and it still bites me. My inner cynic says I shouldn’t expect better because there’s no money in it for \G{oogle}.

Sorry. This post didn’t make the world better. Please forgive this indulgence. I shall try harder tomorrow.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 15, 2022, 8:34pm UTC](https://forum.ansible.com/t/playbook-skips-the-debug-for-no-reason/37354/5 "2022-11-15T20:34:29Z")

</div>

@Todd Lewis why I favor gist/pastebin for showing the code, both in  
groups and/or irc/matrix

A 2nd best is using 'text format' and monospaced fonts.

---

<div class="post-metadata">

**Author:** ![Veera](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/veera/32/4107_2.png) [@Veera](https://forum.ansible.com/u/Veera)\
**Post date:** [November 16, 2022, 12:13pm UTC](https://forum.ansible.com/t/playbook-skips-the-debug-for-no-reason/37354/6 "2022-11-16T12:13:48Z")

</div>

Thanks … I have set the indent right and it was working .  
Actucally i tried various verbosity level and indent in the debug module , which was not helping .

However , in future I will avoid bringing in atleast indent releated issues here …

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [November 16, 2022, 12:22pm UTC](https://forum.ansible.com/t/playbook-skips-the-debug-for-no-reason/37354/7 "2022-11-16T12:22:20Z")

</div>

We all have the indent challenge from time to time. Tools like vscode or turning on language aware settings in VIM can help. This is my .vimrc file. It turns on syntax highlighting and filetype / language aware features. This is on macOS but should work on Linux too. I also set F7 to toggle syntax on and off highlighting.

:filetype on  
:filetype plugin on  
:filetype indent on  
:syntax on  
:map :if exists(“syntax\_on”) syntax off else syntax on endif

I used to use Atom for code editing. Development ceased and I have switched to VSCode.

Walter
