<p>I want to install the new cluster on 3 machines.
I ran this command:</p>
<pre><code>ansible-playbook -i inventory/local/hosts.ini --become --become-user=root cluster.yml

but the installation failed:
TASK [remove-node/pre-remove : remove-node | List nodes] *********************************************************************************************************************************************************
fatal: [node1 -&gt; node1]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;cmd&quot;: [&quot;/usr/local/bin/kubectl&quot;, &quot;--kubeconfig&quot;, &quot;/etc/kubernetes/admin.conf&quot;, &quot;get&quot;, &quot;nodes&quot;, &quot;-o&quot;, &quot;go-template={{ range .items }}{{ .metadata.name }}{{ &quot;\n&quot; }}{{ end }}&quot;], &quot;delta&quot;: &quot;0:00:00.057781&quot;, &quot;end&quot;: &quot;2022-03-16 21:27:20.296592&quot;, &quot;msg&quot;: &quot;non-zero return code&quot;, &quot;rc&quot;: 1, &quot;start&quot;: &quot;2022-03-16 21:27:20.238811&quot;, &quot;stderr&quot;: &quot;error: stat /etc/kubernetes/admin.conf: no such file or directory&quot;, &quot;stderr_lines&quot;: [&quot;error: stat /etc/kubernetes/admin.conf: no such file or directory&quot;], &quot;stdout&quot;: &quot;&quot;, &quot;stdout_lines&quot;: []}
</code></pre>
<p>Why the installation step tried to remove and why <code>/etc/kubernetes/admin.conf</code> has not been created?</p>
<p>Please assist.</p>

<p>There could be a couple of ways how can you solve your problem. First look at <a href="https://github.com/kubernetes-sigs/kubespray/issues/8396" rel="nofollow noreferrer">this github issue</a>. Probably you can manually copy the missing file and it should work:</p>
<blockquote>
<p>I solved it myself.</p>
<p>I copied the /etc/kubernetes/admin.conf and /etc/kubernetes/ssl/ca.* to the new node and now the scale playbook works. Maybe this is not the right way, but it worked...</p>
</blockquote>
<p>The another way is to use <a href="https://docs.ansible.com/ansible/latest/collections/ansible/builtin/wait_for_module.html" rel="nofollow noreferrer">wait for module</a> on Ansible. You can find example of usage in <a href="https://stackoverflow.com/questions/57808932/setup-kubernetes-using-ansible">this thread</a>.</p>
<p>To another solution I will recommend to read <a href="https://superuser.com/questions/1665122/kubernetes-installation-using-ansible-fails-for-admin-conf-not-found">this similar problem</a>:</p>
<blockquote>
<p>cluster_initialized.txt created on first fail and ansible never runs kubeadm init again. just delete that file on fail, fix the problem and run again.</p>
</blockquote>
