-
Notifications
You must be signed in to change notification settings - Fork 0
/
reset.yml
44 lines (41 loc) · 913 Bytes
/
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
---
- hosts: all
gather_facts: no
become: true
become_method: sudo
tags:
- reset
tasks:
- name: K8s reset
command: kubeadm reset
environment:
KUBECONFIG: /etc/kubernetes/admin.conf
- name: Docker prune
command: docker system prune -af
- name: Reload systemd
systemd:
daemon_reload: yes
- name: Stop docker
systemd:
name: docker
state: stopped
- name: Remove /var/lib/docker
file:
path: /var/lib/docker
state: absent
- name: Restart
systemd:
name: kubelet
state: restarted
- name: restart the box
command: /sbin/shutdown -r +1
async: 0
poll: 0
- name: wait for PI to come back
local_action: wait_for
args:
host: "{{ ansible_ssh_host }}"
port: 22
state: started
delay: 70
timeout: 300