diff --git a/roles/download/tasks/main.yml b/roles/download/tasks/main.yml index 8fba48f2b..aa2498043 100644 --- a/roles/download/tasks/main.yml +++ b/roles/download/tasks/main.yml @@ -12,7 +12,6 @@ when: - kube_version is version('v1.11.0', '>=') - not skip_downloads|default(false) - - not skip_kubeadm_images|default(false) - inventory_hostname in groups['kube-master'] tags: - download diff --git a/roles/download/tasks/prep_kubeadm_images.yml b/roles/download/tasks/prep_kubeadm_images.yml index 8187a30cc..2461626db 100644 --- a/roles/download/tasks/prep_kubeadm_images.yml +++ b/roles/download/tasks/prep_kubeadm_images.yml @@ -21,6 +21,8 @@ template: src: "kubeadm-images.yaml.j2" dest: "{{ kube_config_dir }}/kubeadm-images.yaml" + when: + - not skip_kubeadm_images|default(false) - name: prep_kubeadm_images | Copy kubeadm binary from download dir to system path synchronize: @@ -43,6 +45,8 @@ register: kubeadm_images_raw run_once: true changed_when: false + when: + - not skip_kubeadm_images|default(false) - name: prep_kubeadm_images | Parse list of images vars: @@ -59,8 +63,12 @@ loop: "{{ kubeadm_images_list | flatten(levels=1) }}" register: kubeadm_images_cooked run_once: true + when: + - not skip_kubeadm_images|default(false) - name: prep_kubeadm_images | Convert list of images to dict for later use set_fact: kubeadm_images: "{{ kubeadm_images_cooked.results | map(attribute='ansible_facts.kubeadm_image') | list | items2dict }}" run_once: true + when: + - not skip_kubeadm_images|default(false)