reoganize storage roles
This commit is contained in:
30
ansible/roles/k8s_destroy/tasks/main.yaml
Normal file
30
ansible/roles/k8s_destroy/tasks/main.yaml
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
- name: reset the nodes
|
||||
ansible.builtin.shell:
|
||||
cmd: |
|
||||
kubeadm reset -f
|
||||
|
||||
- name: delete orphaned files
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: absent
|
||||
with_items:
|
||||
- /etc/cni
|
||||
- /etc/kubernetes
|
||||
- /var/lib/dockershim
|
||||
- /var/lib/etcd
|
||||
- /var/lib/kubelet
|
||||
- /var/run/kubernetes
|
||||
|
||||
- name: purge iptables
|
||||
ansible.builtin.shell:
|
||||
cmd: |
|
||||
iptables -F && iptables -X
|
||||
iptables -t nat -F && iptables -t nat -X
|
||||
iptables -t raw -F && iptables -t raw -X
|
||||
iptables -t mangle -F && iptables -t mangle -X
|
||||
|
||||
- name: restart the containerd service
|
||||
ansible.builtin.service:
|
||||
name: containerd
|
||||
state: restarted
|
Reference in New Issue
Block a user