-
Notifications
You must be signed in to change notification settings - Fork 8
/
symplegma-reset.yml
45 lines (45 loc) · 1.33 KB
/
symplegma-reset.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
---
- hosts: master:node
vars_files:
- defaults/main.yml
tasks:
- name: Reset | Run Kubeadm reset on node
shell: |
{{ bin_dir }}/kubeadm reset -f --cri-socket "{{ cri_socket }}"
- name: Reset | Cleanup /root
file:
path: "/root/{{ item }}"
state: absent
with_items:
- kubeadm-config.yaml
- rbac-kdd.yaml
- calico.yaml
- name: Reset | CNI config
file:
path: "/etc/cni/net.d"
state: absent
- name: Reset | CNI config
file:
path: "/etc/cni/net.d"
state: directory
- name: Reset | Cleanup leftover pods
shell: |
{{ bin_dir }}/crictl --runtime-endpoint {{ cri_socket }} pods -q | xargs {{ bin_dir }}/crictl --runtime-endpoint {{ cri_socket }} stopp
{{ bin_dir }}/crictl --runtime-endpoint {{ cri_socket }} pods -q | xargs {{ bin_dir }}/crictl --runtime-endpoint {{ cri_socket }} rmp
- name: Reset | Restart services
systemd:
state: restarted
daemon_reload: yes
name: "{{ item }}"
no_block: yes
loop:
- kubelet
- containerd
- name: Reset | Reenable SWAP in fstab (1/2)
replace:
path: /etc/fstab
regexp: '^# (.+?\sswap\s+sw\s+.*)$'
replace: '\1'
- name: Reset | Enable SWAP (2/2)
shell: |
swapon -a