Hyunsun Moon | e484834 | 2020-02-16 04:28:55 -0800 | [diff] [blame] | 1 | # 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 |
Hyunsun Moon | 6c6db95 | 2020-03-04 20:50:51 -0800 | [diff] [blame^] | 26 | changed_when: False |
Hyunsun Moon | e484834 | 2020-02-16 04:28:55 -0800 | [diff] [blame] | 27 | tags: k8s |
| 28 | |
| 29 | - name: Remove directories |
| 30 | file: |
| 31 | path: "{{ item }}" |
| 32 | state: absent |
| 33 | ignore_errors: yes |
| 34 | with_items: |
| 35 | - /etc/kubernetes |
| 36 | - /etc/cni |
| 37 | - /opt/cni |
| 38 | - /opt/rke |
| 39 | - /run/secrets/kubernetes.io |
| 40 | - /run/calico |
| 41 | - /var/lib/calico |
| 42 | - /var/lib/etcd |
| 43 | - /var/lib/cni |
| 44 | - /var/lib/kubelet |
| 45 | - /var/lib/rancher/rke/log |
| 46 | - /var/log/containers |
| 47 | - /var/log/pods |
| 48 | - /var/run/calico |
Hyunsun Moon | 6c6db95 | 2020-03-04 20:50:51 -0800 | [diff] [blame^] | 49 | changed_when: False |
Hyunsun Moon | e484834 | 2020-02-16 04:28:55 -0800 | [diff] [blame] | 50 | tags: k8s |