Yes, it worked like a charm by going with:
- name: print collection result
ansible.builtin.debug:
msg: "{{ item.path }}"
loop: "{{ log_search.files }}"
loop_control:
label: "{{ item.path }}"
Again, thanks a lot!
Alex
On Tue, Mar 26, 2024 at 4:43 PM Alex
Thanks for the quick reply, Matt...!
I'll take a look at that...
Alex
On Tue, Mar 26, 2024 at 4:37 PM Matt Martz wrote:
> The functionality you are looking for is the `label` option of
> `loop_control`:
> https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html#limiting-loop
The functionality you are looking for is the `label` option of
`loop_control`:
https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html#limiting-loop-output-with-label
On Tue, Mar 26, 2024 at 5:36 PM Alex Wanderley
wrote:
> Hello,
>
> We have a simple/working playbook that loo
Hello,
We have a simple/working playbook that looks for log files based on the
server's name and prints the file(s) it could find:
vars:
log_files: "/path/to/directory"
tasks:
- name: Collect log files
ansible.builtin.find:
path: "{{ log_files }}/"
patterns: