-
Notifications
You must be signed in to change notification settings - Fork 1
/
destroy.yml
58 lines (49 loc) · 1.29 KB
/
destroy.yml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
- hosts: all
gather_facts: yes
become: yes
tasks:
- name: stop services
systemd:
name: "{{ item }}"
state: stopped
ignore_errors: True
loop:
- containerd
- docker
- etcd
- kubelet
- name: Full Cleaning
file:
path: "{{ item }}"
state: absent
loop:
- /etc/kubernetes
- /var/lib/etcd
- /var/lib/kubernetes
- /var/lib/kubelet
- /etc/cni/net.d
ignore_errors: True
# - name: iptables flush
# become: yes
# shell: "sudo iptables -t nat -F && sudo iptables -t mangle -F && sudo iptables -F && sudo iptables -X"
# ignore_errors: True
- name: delete cbr0
become: yes
shell: "ifconfig cbr0 down && brctl delbr cbr0"
ignore_errors: True
- name: delete cni0
become: yes
shell: "ifconfig cni0 down && ip link delete cni0"
ignore_errors: True
- name: delete kube-ipvs0
become: yes
shell: "ifconfig kube-ipvs0 down && ip link delete kube-ipvs0"
ignore_errors: True
- name: delete flannel0
become: yes
shell: "ifconfig flannel.1 down && ip link delete flannel.1"
ignore_errors: True
- name: clear ip route
become: yes
shell: "ip route flush cache"