add delete all pods

This commit is contained in:
2025-07-08 13:26:30 +09:00
parent 43a38ed66d
commit e8cacebe2b
4 changed files with 18 additions and 5 deletions

View File

@@ -16,10 +16,6 @@
cp -r /var/lib/etcd/* /tmp/etcd-backup-{{ time }}
failed_when: false
#- name: "[{{ target }} / 2-etcd-restore.yml] etcd original file delete"
# shell: |
# rm -rf /var/lib/etcd/*
- name: "[{{ target }} / 2-etcd-restore.yml] find old etcd file and directory"
find:
path: /var/lib/etcd

View File

@@ -0,0 +1,12 @@
---
- name: Sleep for 1 min
debug:
msg:
Sleep for 1 min
- name: Sleep for 1 min done!
wait_for:
timeout: 60
- name: delete all pods
shell: kubectl delete pods -A --all --force --grace-period=0

View File

@@ -38,3 +38,8 @@
when:
- ("host-master" in group_names or "host-master-cluster" in group_names) and target == "host" or
("member-master" in group_names or "member-master-cluster" in group_names) and target == "member"
- include: "8-delete-all-pods.yml"
when:
- ("host-master" in group_names) and target == 'host' or
("member-master" in group_names) and target == 'member'