<p>I would like to copy the kube admin config file from the Kubernetes master host to the nodes using ansible synchronize but that fails due to a missing python interpreter, but I have already installed docker on all machines without any issue. </p>

<p>See my task </p>

<p><code>- name: admin conf file to nodes
      environment:
        ANSIBLE_PYTHON_INTERPRETER: python3
      synchronize:
        src: /home/{{ansible_ssh_user}}/.kube/config
        dest: /home/{{ansible_ssh_user}}
      delegate_to: "{{item}}"
      loop: "{{groups.node}}"
</code></p>

<p>You can use synchronize module only when rsync is enabled either in source server (kube master in your case) or in the kube nodes.</p>

<h3>Method 1: to push from master, need rsync enabled in master</h3>

<p>Synchronize use <code>push</code> mode by default </p>

<pre><code>- hosts: nodes
  tasks:
    - name: Transfer file from master to nodes
      synchronize:
        src: /etc/kubernetes/admin.conf
        dest: $HOME/.kube/config
      delegate_to: "{{ master }}"
</code></pre>

<h3>Method 2: to use fetch and copy modules</h3>

<pre><code> - hosts: all
   tasks:
     - name: Fetch the file from the master to ansible
       run_once: yes
       fetch: src=/etc/kubernetes/admin.conf dest=temp/ flat=yes
       when: "{{ ansible_hostname == 'master' }}"
     - name: Copy the file from the ansible to nodes
       copy: src=temp/admin.conf dest=$HOME/.kube/config
       when: "{{ ansible_hostname != 'master' }}"
</code></pre>

<p>Hope this helps. </p>
