Add one more step (task) to containers download/upload sequence -
copy saved .tar containers to ansible host (delegate_to: localhost).
Then upload images to target nodes. It uses synchronize module so
if ansible host (localhost) is the same host as kube-master[0] then
new task causes no issues and the copy to localhost process is
basically skipped.
when:"{{ download.enabled|bool and download.container|bool }}"
- name:Download | copy container images to ansible host
synchronize:
src:"{{ fname }}"
dest:"{{ fname }}"
mode:pull
delegate_to:localhost
become:false
when:ansible_os_family != "CoreOS" and inventory_hostname == groups['kube-master'][0] and download_run_once|bool and download.enabled|bool and download.container|bool
- name:Download | upload container images to nodes