From 6025981ceb30bf1599de2770a53178fdacf6d978 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Sun, 23 Jun 2019 23:17:56 -0700 Subject: [PATCH] Allow skip kubeadm image prep but install kubeadm (#4904) Change-Id: I744e9a192cd863a1ce22fbd16d217c5dfb16750c --- roles/download/tasks/main.yml | 1 - roles/download/tasks/prep_kubeadm_images.yml | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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)