summaryrefslogtreecommitdiff
path: root/roles/kubernetes/kubeadm/reset/tasks/main.yml
blob: cf9c125dcd64ad57e042589ff2ea051b8a219e1e (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
28
29
30
31
32
33
34
35
---
- 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-init.errors
    - /etc/kubernetes/kubeadm-join.log
    - /etc/kubernetes/kubeadm-join.errors
    - /etc/kubernetes/pki
    - /etc/kubernetes/encryption
    - /etc/kubernetes/network-plugin.yml
    - /etc/kubernetes/node-local-dns.yml
    - /etc/kubernetes/addons
  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

- name: extra-cleanup for kubeguard network plugin
  import_tasks: net_kubeguard.yml