diff --git a/roles/download/tasks/main.yml b/roles/download/tasks/main.yml index 9139d009b..d3b20dd10 100644 --- a/roles/download/tasks/main.yml +++ b/roles/download/tasks/main.yml @@ -18,13 +18,15 @@ - name: Download | Download files / images include_tasks: "{{ include_file }}" - loop: "{{ downloads | combine(kubeadm_images) | dict2items }}" + loop: "{{ [] if skip_downloads + else ( + (downloads | combine(kubeadm_images)).values() + | selectattr('enabled') + ) + }}" vars: - download: "{{ download_defaults | combine(item.value) }}" + download: "{{ download_defaults | combine(item) }}" include_file: "download_{% if download.container %}container{% else %}file{% endif %}.yml" when: - - not skip_downloads - - download.enabled - - item.value.enabled - (not download.container) or (download.container and download_container) - (download_run_once and inventory_hostname == download_delegate) or (group_names | intersect(download.groups) != [])