Based on v2.8, I don’t think you can wildcard filenames with fetch and it doesn’t seem to have owner, group or mode parameters (like copy) either. I think this discussion about a “wrapper” script or using the alternative synchronise module may help with your particular query though?:
- name: use find to get the files list which you want to copy/fetch
find:
paths: /tmp/
patterns: ".*exe"
use_regex: True
register: file_2_fetch
- name: use fetch to get the files
fetch:
src: "{{ item.path }}"
dest: /tmp/
flat: yes
with_items: "{{ file_2_fetch.files }}"
*Thanks & Regards,*
*Rahul Kolan*
*DISCLAIMER: *
This message including attachments if any intended solely for specific
individual and purpose & may contain confidential material AND/OR Private
Company Information. If you are not the intended recipient, any disclosure,
copying or distribution of this message or any action based on it, is
strictly prohibited & protected under relevant law. If you have received
this communication in error, please contact the sender or delete this
message immediately. Thank you for your kind cooperation.