I have below Ansible (2.9.6 ) task to list the files in windows machines, some machine it works. for some server its giving warning not listing any files. any help to resolve this issue?
---
- name: getdir
hosts: all
gather_facts: false
tasks:
- name: Find direcotry
win_find:
paths: d:\
recurse: no
get_checksum: no
register: result
- name: Find direcotry
debug:
msg: "output {{ result }}"
Sample output:
TASK [Find direcotry] ************************************************************************************************************************************************************************
[WARNING]: win_find failed to check some files, these files were ignored and will not be part of the result output
ASK [Find direcotry] ************************************************************************************************************************************************************************
ok: [host01] => {
"msg": "output {u'files': [], u'warnings': [u'win_find failed to check some files, these files were ignored and will not be part of the result output'], u'changed': False, 'failed': False, u'examined': 0, u'matched': 0}"
}