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
|
|
|
|
notify:
|
2019-04-19 21:01:54 +08:00
|
|
|
- delete 10-calico.conflist
|
2019-07-16 23:35:24 +08:00
|
|
|
- docker | delete calico-node containers
|
|
|
|
- containerd | delete calico-node 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
|
|
|
|
2019-07-16 23:35:24 +08:00
|
|
|
- name: docker | delete calico-node containers
|
2019-04-19 21:01:54 +08:00
|
|
|
shell: "docker ps -af name=k8s_POD_calico-node* -q | xargs --no-run-if-empty docker rm -f"
|
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"]
|
|
|
|
|
|
|
|
- name: containerd | delete calico-node containers
|
|
|
|
shell: 'crictl pods --name calico-node-* -q | xargs -I% --no-run-if-empty bash -c "crictl stopp % && crictl rmp %"'
|
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"]
|
2019-10-02 19:37:07 +08:00
|
|
|
|
|
|
|
- name: Calico | Reload NetworkManager
|
|
|
|
service:
|
|
|
|
name: NetworkManager
|
|
|
|
state: reloaded
|
|
|
|
when: '"running" in nm_check.stdout'
|