blob: ffb8922b7e1aeb40210b009402324d049bb5fc22 [file] [log] [blame]
Hyunsun Moone4848342020-02-16 04:28:55 -08001# Copyright 2020-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15---
16- name: Remove containers
17 shell: |
18 docker stop $(docker ps -aq)
19 docker system prune -f
20 docker volume rm $(docker volume ls -q)
21 docker image rm $(docker image ls -q)
22 register: remove_all_containers
23 retries: 4
24 delay: 5
25 until: remove_all_containers.rc == 0
26 tags: k8s
27
28- name: Remove directories
29 file:
30 path: "{{ item }}"
31 state: absent
32 ignore_errors: yes
33 with_items:
34 - /etc/kubernetes
35 - /etc/cni
36 - /opt/cni
37 - /opt/rke
38 - /run/secrets/kubernetes.io
39 - /run/calico
40 - /var/lib/calico
41 - /var/lib/etcd
42 - /var/lib/cni
43 - /var/lib/kubelet
44 - /var/lib/rancher/rke/log
45 - /var/log/containers
46 - /var/log/pods
47 - /var/run/calico
48 tags: k8s