From c672681ce5ba9b8580c78d930eaac740afa26307 Mon Sep 17 00:00:00 2001
From: Michael Oglesby <44730324+mboglesby@users.noreply.github.com>
Date: Thu, 17 Oct 2019 08:26:37 -0400
Subject: [PATCH] Revert Pull Request #5084 (#5120)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Kubespray Pull Request #5084 (https://github.com/kubernetes-sigs/kubespray/pull/5084) caused more problems than it solved due to limitations with the synchronize module. See comments on Kubespray Issues #5059 (https://github.com/kubernetes-sigs/kubespray/issues/5059) and #5116 (https://github.com/kubernetes-sigs/kubespray/issues/5116). Details from Ansible documentation: "Currently, synchronize is limited to elevating permissions via passwordless sudo. This is because rsync itself is connecting to the remote machine and rsync doesn’t give us a way to pass sudo credentials in. ... Currently there are only a few connection types which support synchronize (ssh, paramiko, local, and docker) because a sync strategy has been determined for those connection types. Note that the connection for these must not need a password as rsync itself is making the connection and rsync does not provide us a way to pass a password to the connection. ..." Thus, reverting Pull Request #5084.
---
 roles/kubernetes/client/tasks/main.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/roles/kubernetes/client/tasks/main.yml b/roles/kubernetes/client/tasks/main.yml
index 833b05a02..a902a78ea 100644
--- a/roles/kubernetes/client/tasks/main.yml
+++ b/roles/kubernetes/client/tasks/main.yml
@@ -74,9 +74,11 @@
   when: kubeconfig_localhost|default(false)
 
 - name: Copy kubectl binary to ansible host
-  synchronize:
+  fetch:
     src: "{{ bin_dir }}/kubectl"
     dest: "{{ artifacts_dir }}/kubectl"
+    flat: yes
+    validate_checksum: no
   become: no
   run_once: yes
   when: kubectl_localhost|default(false)
-- 
GitLab