# Reduce output of ansible-playbook command

**URL:** <https://forum.ansible.com/t/reduce-output-of-ansible-playbook-command/35459>\
**Category:** Ansible Project\
**Created:** [July 3, 2021, 2:12pm UTC](https://forum.ansible.com/t/reduce-output-of-ansible-playbook-command/35459 "2021-07-03T14:12:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rolandm](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rolandm/32/755_2.png) [@rolandm](https://forum.ansible.com/u/rolandm)\
**Post date:** [July 3, 2021, 2:12pm UTC](https://forum.ansible.com/t/reduce-output-of-ansible-playbook-command/35459/1 "2021-07-03T14:12:19Z")

</div>

Hello,

is there some option to make ansible-playbook “quiet” about its own output and print only the explicit debug msg in line #17 . I tried to ‘use no\_log: True’ both on task and tasks level but it suppresses all output.

Thanks in advance & BR,  
Roland

ansible-playbook reduce\_output.yaml

…

ok: [localhost] =\> (item={‘path’: ‘/tmp/.X11-unix/X0’, ‘mode’: ‘0777’, ‘isdir’: False, ‘ischr’: False, ‘isblk’: False, ‘isreg’: False, ‘isfifo’: False, ‘islnk’: False, ‘issock’: True, ‘uid’: 0, ‘gid’: 0, ‘size’: 0, ‘inode’: 38, ‘dev’: 37, ‘nlink’: 1, ‘atime’: 1625305628.0993037, ‘mtime’: 1625305628.0993037, ‘ctime’: 1625305628.0993037, ‘gr\_name’: ‘root’, ‘pw\_name’: ‘root’, ‘wusr’: True, ‘rusr’: True, ‘xusr’: True, ‘wgrp’: True, ‘rgrp’: True, ‘xgrp’: True, ‘woth’: True, ‘roth’: True, ‘xoth’: True, ‘isuid’: False, ‘isgid’: False}) =\> {  
“msg”: “\* FILE: /tmp/.X11-unix/X0”  
}

1 —

2 - name: ‘playbook debugging output from find’  
3 hosts: localhost  
4 gather\_facts: no  
5 ##no\_log: True ##kills all output ☹  
6  
7 tasks:  
8 - name: find /tmp  
9 find:  
10 path: /tmp/  
11 file\_type: any # default: file  
12 recurse: yes # default false  
13 register: out  
14  
15 - name: list files line by line  
16 debug:  
17 msg: “\* FILE: {{ item.path }}”  
18 with\_items:  
19 - “{{ out.files }}”

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [July 3, 2021, 3:01pm UTC](https://forum.ansible.com/t/reduce-output-of-ansible-playbook-command/35459/2 "2021-07-03T15:01:59Z")

</div>

> Hello,
> 
> is there some option to make ansible-playbook "quiet" about its own output and print only the explicit debug msg in line #17 . I tried to 'use no\_log: True' both on task and tasks level but it suppresses all output.
> 
> Thanks in advance & BR,  
> Roland

Hello Roland,

did you try "no\_log: False" specifically for the debug task?

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![rolandm](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rolandm/32/755_2.png) [@rolandm](https://forum.ansible.com/u/rolandm)\
**Post date:** [July 4, 2021, 7:12am UTC](https://forum.ansible.com/t/reduce-output-of-ansible-playbook-command/35459/3 "2021-07-04T07:12:32Z")

</div>

> > Hello,
> > 
> > is there some option to make ansible-playbook “quiet” about its own output and print only the explicit debug msg in line #17 . I tried to ‘use no\_log: True’ both on task and tasks level but it suppresses all output.
> > 
> > Thanks in advance & BR,  
> > Roland
> 
> Hello Roland,
> 
> did you try “no\_log: False” specifically for the debug task?
> 
> Regards  
> Racke

Hello Racke,

yes, I did that too (as I mentioned in my previous message): It has following consequence. Thus, all debug output is suppressed and an item=None line is printed for every finding of find task.

…  
TASK [list files line by line] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> (item=None)  
ok: [localhost] =\> (item=None)  
ok: [localhost] =\> (item=None)  
…

BR,  
Roland

---

<div class="post-metadata">

**Author:** ![Erik\_Godding\_Boye](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@Erik\_Godding\_Boye](https://forum.ansible.com/u/Erik_Godding_Boye)\
**Post date:** [July 4, 2021, 2:03pm UTC](https://forum.ansible.com/t/reduce-output-of-ansible-playbook-command/35459/4 "2021-07-04T14:03:16Z")

</div>

You could try loop\_control:  
[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_loops.html#limiting-loop-output-with-label](https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#limiting-loop-output-with-label)

---

<div class="post-metadata">

**Author:** ![rolandm](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rolandm/32/755_2.png) [@rolandm](https://forum.ansible.com/u/rolandm)\
**Post date:** [July 4, 2021, 7:52pm UTC](https://forum.ansible.com/t/reduce-output-of-ansible-playbook-command/35459/5 "2021-07-04T19:52:53Z")

</div>

Hello Eric,
