updated logic
diff --git a/tasks/download_files.yml b/tasks/download_files.yml index eb024a4..6f89a70 100644 --- a/tasks/download_files.yml +++ b/tasks/download_files.yml
@@ -6,11 +6,10 @@ - name: Examine result passed in debug: - var: result.files + var: file_result.files - name: Download files fetch: src: "{{ item.path }}" dest: "{{ download_folder }}" - with_items: "{{ result.files }}" - when: result is defined + with_items: file_result.files
diff --git a/tasks/main.yml b/tasks/main.yml index 026d392..77b4651 100644 --- a/tasks/main.yml +++ b/tasks/main.yml
@@ -24,10 +24,11 @@ with_items: "{{ downloads.results }}" - name: Iterate over files found - include: download_file.yml - vars: - result: "{{ item }}" + include: download_files.yml with_items: "{{ downloads.results }}" + loop_control: + label: "{{ item }}" + loop_var: file_result