2016-01-30 23:04:47 +08:00
|
|
|
---
|
2019-04-19 21:01:54 +08:00
|
|
|
- name: reset_calico_cni
|
2016-01-30 23:04:47 +08:00
|
|
|
command: /bin/true
|
2020-11-13 16:02:23 +08:00
|
|
|
when: calico_cni_config is defined
|
2016-01-30 23:04:47 +08:00
|
|
|
notify:
|
2019-04-19 21:01:54 +08:00
|
|
|
- delete 10-calico.conflist
|
2021-01-18 17:41:44 +08:00
|
|
|
- Calico | delete calico-node docker containers
|
|
|
|
- Calico | delete calico-node crio/containerd containers
|
2016-01-30 23:04:47 +08:00
|
|
|
|
2019-04-19 21:01:54 +08:00
|
|
|
- name: delete 10-calico.conflist
|
|
|
|
file:
|
2019-07-16 23:35:24 +08:00
|
|
|
path: /etc/cni/net.d/10-calico.conflist
|
2019-04-19 21:01:54 +08:00
|
|
|
state: absent
|
2016-01-30 23:04:47 +08:00
|
|
|
|
2021-01-18 17:41:44 +08:00
|
|
|
- name: Calico | delete calico-node docker containers
|
2023-06-26 18:15:45 +08:00
|
|
|
shell: "set -o pipefail && {{ docker_bin_dir }}/docker ps -af name=k8s_POD_calico-node* -q | xargs --no-run-if-empty {{ docker_bin_dir }}/docker rm -f"
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
2019-10-28 20:11:25 +08:00
|
|
|
register: docker_calico_node_remove
|
|
|
|
until: docker_calico_node_remove is succeeded
|
|
|
|
retries: 5
|
2019-07-16 23:35:24 +08:00
|
|
|
when: container_manager in ["docker"]
|
|
|
|
|
2021-01-18 17:41:44 +08:00
|
|
|
- name: Calico | delete calico-node crio/containerd containers
|
2023-06-26 18:15:45 +08:00
|
|
|
shell: 'set -o pipefail && {{ bin_dir }}/crictl pods --name calico-node-* -q | xargs -I% --no-run-if-empty bash -c "{{ bin_dir }}/crictl stopp % && {{ bin_dir }}/crictl rmp %"'
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
2019-10-28 20:11:25 +08:00
|
|
|
register: crictl_calico_node_remove
|
|
|
|
until: crictl_calico_node_remove is succeeded
|
|
|
|
retries: 5
|
2019-07-16 23:35:24 +08:00
|
|
|
when: container_manager in ["crio", "containerd"]
|