c12s-kubespray/roles/network_plugin/kube-router/handlers/main.yml
Alexander D. Kanevskiy d4204a42fd
Fix crictl paths and some of docker paths (#6961)
If crictl (and docker) binaries are deployed to the directories
that are not in standard PATH (e.g. /usr/local/bin), it is required
to specify full path to the binaries.
2020-11-28 08:30:47 -08:00

20 lines
818 B
YAML

---
- name: reset_kube_router
command: /bin/true
notify:
- docker | delete kube-router containers
- containerd | delete kube-router containers
- name: docker | delete kube-router containers
shell: "{{ docker_bin_dir }}/docker ps -af name=k8s_POD_kube-router* -q | xargs --no-run-if-empty docker rm -f"
register: docker_kube_router_remove
until: docker_kube_router_remove is succeeded
retries: 5
when: container_manager in ["docker"]
- name: containerd | delete kube-router containers
shell: '{{ bin_dir }}/crictl pods --name kube-router* -q | xargs -I% --no-run-if-empty bash -c "{{ bin_dir }}/crictl stopp % && {{ bin_dir }}/crictl rmp %"'
register: crictl_kube_router_remove
until: crictl_kube_router_remove is succeeded
retries: 5
when: container_manager in ["crio", "containerd"]