--- - name: find a specific file across hosts and return its host and path hosts: all collections: ansible.posix gather_facts: no become: true tasks: - name: run find command find: file_type: file # excludes: '/tmp,/sbin,/bin,/run,/media,/mnt,/proc,lost+found,/lib,/lib64,/srv,/sys,/boot,/dev' paths: /home,/root recurse: yes patterns: '*update.sh*' use_regex: no register: output - debug: var=item.path with_items: "{{ output.files }}"