From 338eb4ce659f8c4214e75b44b616780e706d9126 Mon Sep 17 00:00:00 2001
From: Matthew Mosesohn <matthew.mosesohn@gmail.com>
Date: Sat, 27 Apr 2019 11:14:20 +0300
Subject: [PATCH] Fix kubeadm upload certs with when condition (#4659)

* Fix kubeadm upload certs with when condition

Change-Id: I916dd2375b71eea2386047c7f185a2f8361f7a61

* Update kubeadm-secondary-experimental.yml
---
 .../master/tasks/kubeadm-secondary-experimental.yml           | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/roles/kubernetes/master/tasks/kubeadm-secondary-experimental.yml b/roles/kubernetes/master/tasks/kubeadm-secondary-experimental.yml
index b204dbba0..9a3f8fe11 100644
--- a/roles/kubernetes/master/tasks/kubeadm-secondary-experimental.yml
+++ b/roles/kubernetes/master/tasks/kubeadm-secondary-experimental.yml
@@ -34,9 +34,9 @@
     {% if kubeadm_certificate_key is defined %}
     --certificate-key={{ kubeadm_certificate_key }}
     {% endif %}
-  run_once: yes
   register: kubeadm_upload_cert
-  delegate_to: "{{ groups['kube-master'][0] }}"
+  when:
+    - inventory_hostname == groups['kube-master']|first
 
 - name: Parse certificate key if not set
   set_fact:
-- 
GitLab