summaryrefslogtreecommitdiff
path: root/roles/kubernetes/kubeadm/reset/tasks/main.yml
blob: c35e2bfc88292411813d0aa092a75225bd36a836 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
- name: clean up settings and files created by kubeadm
  command: kubeadm reset -f

- name: clean up extra configs and logs
  loop:
    - /etc/kubernetes/kubeadm.config
    - /etc/kubernetes/kubeadm-init.log
    - /etc/kubernetes/kubeadm-join.log
    - /etc/kubernetes/pki
    - /etc/kubernetes/encryption
  file:
    path: "{{ item }}"
    state: absent

- name: get list of all cni configs
  find:
    paths: /etc/cni/net.d
  register: kubeadm_reset_cni

- name: remove all cni configs
  loop: "{{ kubeadm_reset_cni.files }}"
  loop_control:
    label: "{{ item.path }}"
  file:
    path: "{{ item.path }}"
    state: absent