diff --git a/roles/kcp/tasks/main.yml b/roles/kcp/tasks/main.yml index 19d0fbe..ed8a90c 100644 --- a/roles/kcp/tasks/main.yml +++ b/roles/kcp/tasks/main.yml @@ -16,13 +16,6 @@ owner: kube group: kube mode: ug+rwx,o+r -- name: Copy reset config - ansible.builtin.copy: - src: reset.yaml - dest: /etc/kubeadm/reset.yaml - owner: kube - group: kube - mode: ugo+rw - name: Drop init token ansible.builtin.file: dest: /etc/kubeadm/init.token diff --git a/roles/reset/tasks/main.yml b/roles/reset/tasks/main.yml index e69de29..b417ed4 100644 --- a/roles/reset/tasks/main.yml +++ b/roles/reset/tasks/main.yml @@ -0,0 +1,15 @@ +--- +### +# ```{rubric} Force reset an existing cluster +# ``` +# --- +# Record the output to stdout and a temporary file. +- name: Reset existing cluster + ansible.builtin.command: + chdir: /etc/kubeadm + cmd: kubeadm reset -f &> /root/reset.md + removes: /etc/kubernetes/admin.conf + register: reset_out +- name: Show output + ansible.builtin.debug: + var: reset_out