2016-01-30 15:04:47 +00:00
|
|
|
---
|
2019-04-19 13:01:54 +00:00
|
|
|
- name: reset_calico_cni
|
2016-01-30 15:04:47 +00:00
|
|
|
command: /bin/true
|
2020-11-13 08:02:23 +00:00
|
|
|
when: calico_cni_config is defined
|
2016-01-30 15:04:47 +00:00
|
|
|
notify:
|
2019-04-19 13:01:54 +00:00
|
|
|
- delete 10-calico.conflist
|
2019-07-16 15:35:24 +00:00
|
|
|
- docker | delete calico-node containers
|
|
|
|
- containerd | delete calico-node containers
|
2016-01-30 15:04:47 +00:00
|
|
|
|
2019-04-19 13:01:54 +00:00
|
|
|
- name: delete 10-calico.conflist
|
|
|
|
file:
|
2019-07-16 15:35:24 +00:00
|
|
|
path: /etc/cni/net.d/10-calico.conflist
|
2019-04-19 13:01:54 +00:00
|
|
|
state: absent
|
2016-01-30 15:04:47 +00:00
|
|
|
|
2019-07-16 15:35:24 +00:00
|
|
|
- name: docker | delete calico-node containers
|
calico: use absolute path to docker, crictl binary (#6253)
To avoid the following error (ignored when pipefail is off)
RUNNING HANDLER [network_plugin/calico : containerd | delete calico-node containers] *******************************************************************************
changed: [node1] => {"attempts": 1, "changed": true, "cmd": "crictl pods --name calico-node-* -q | xargs -I% --no-run-if-empty bash -c \"crictl stopp % && crictl rmp %\"", "delta": "0:00:00.004240", "end": "2020-06-10 03:32:41.316955", "rc": 0, "start": "2020-06-10 03:32:41.312715", "stderr": "/bin/sh: crictl: command not found", "stderr_lines": ["/bin/sh: crictl: command not found"], "stdout": "", "stdout_lines": []}
2020-06-10 10:22:08 +00:00
|
|
|
shell: "{{ docker_bin_dir }}/docker ps -af name=k8s_POD_calico-node* -q | xargs --no-run-if-empty {{ docker_bin_dir }}/docker rm -f"
|
2019-10-28 12:11:25 +00:00
|
|
|
register: docker_calico_node_remove
|
|
|
|
until: docker_calico_node_remove is succeeded
|
|
|
|
retries: 5
|
2019-07-16 15:35:24 +00:00
|
|
|
when: container_manager in ["docker"]
|
|
|
|
|
|
|
|
- name: containerd | delete calico-node containers
|
calico: use absolute path to docker, crictl binary (#6253)
To avoid the following error (ignored when pipefail is off)
RUNNING HANDLER [network_plugin/calico : containerd | delete calico-node containers] *******************************************************************************
changed: [node1] => {"attempts": 1, "changed": true, "cmd": "crictl pods --name calico-node-* -q | xargs -I% --no-run-if-empty bash -c \"crictl stopp % && crictl rmp %\"", "delta": "0:00:00.004240", "end": "2020-06-10 03:32:41.316955", "rc": 0, "start": "2020-06-10 03:32:41.312715", "stderr": "/bin/sh: crictl: command not found", "stderr_lines": ["/bin/sh: crictl: command not found"], "stdout": "", "stdout_lines": []}
2020-06-10 10:22:08 +00:00
|
|
|
shell: '{{ bin_dir }}/crictl pods --name calico-node-* -q | xargs -I% --no-run-if-empty bash -c "{{ bin_dir }}/crictl stopp % && {{ bin_dir }}/crictl rmp %"'
|
2019-10-28 12:11:25 +00:00
|
|
|
register: crictl_calico_node_remove
|
|
|
|
until: crictl_calico_node_remove is succeeded
|
|
|
|
retries: 5
|
2019-07-16 15:35:24 +00:00
|
|
|
when: container_manager in ["crio", "containerd"]
|
2019-10-02 11:37:07 +00:00
|
|
|
|
|
|
|
- name: Calico | Reload NetworkManager
|
|
|
|
service:
|
|
|
|
name: NetworkManager
|
|
|
|
state: reloaded
|
|
|
|
when: '"running" in nm_check.stdout'
|