Get file(s) from a remote host to local host

Hi,

I created a simple yml file to get file or files from a remote host to local host:
$ cat fetch.yml

Your issue is that Apps_files.files is a list, so Apps_files[0].path
would access the path of the FIRST file in that list, which means you
have to extract path for each item to make the fetch loop work:

- name:
  fetch:
    src: "{{ item }}"
    dest: /APPADMIN/ansible/nonprod/DR_test/
   loop: "{{ Apps_files.files|map(attribute='path')|list }}"

Thanks, Brian

That works.