On 03/07/2021 16:12, Roland Müller wrote:
> 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
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3d96fdcc-c78d-4d35-9d7f-0f833e3d8a80n%40googlegroups.com.
Hello Eric,
You could try loop_control:
Thank you very much! This works perfectly.
1 ---
2 - name: 'playbook debugging output from find'
3 hosts: localhost
4 gather_facts: no
5
6 tasks:
7 - name: find /tmp
8 find:
9 path: /tmp
10 file_type: any # default: file
11 recurse: yes # default false
12 register: out
13
14 - name: list files line by line
15 debug:
16 msg: "FILE: {{ item.path }} isreg: {{ item.isreg }}
isdir: {{ item.isdir }}"
17 with_items:
18 - "{{ out.files }}"
19 loop_control:
20 label: "{{ item.path
}}"
Output snippet:
...
TASK [find /tmp]
********************************************************************************************************
ok: [localhost]
TASK [list files line by line]
******************************************************************************************
ok: [localhost] =>
(item=/tmp/OSL_PIPE_1000_SingleOfficeIPC_9eb5d83c64fa8a7cb259953b1032)
=> {
"msg": "FILE:
/tmp/OSL_PIPE_1000_SingleOfficeIPC_9eb5d83c64fa8a7cb259953b1032
isreg: False isdir: False"
}
ok: [localhost] => (item=/tmp/ansible_find_payload_pk8ljuwy)
=> {
"msg": "FILE: /tmp/ansible_find_payload_pk8ljuwy isreg: False
isdir: True"
...
BR,
Roland
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/TVgt8sLly0I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CALfBRgFmHptDH48qDBSZ%3Dnqs3V-tRMrDsLAZRq5DR%2B9hJtV3Gw%40mail.gmail.com.