You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.0 KiB

  1. ---
  2. - name: reset_calico_cni
  3. command: /bin/true
  4. when: calico_cni_config is defined
  5. notify:
  6. - delete 10-calico.conflist
  7. - Calico | delete calico-node docker containers
  8. - Calico | delete calico-node crio/containerd containers
  9. - name: delete 10-calico.conflist
  10. file:
  11. path: /etc/cni/net.d/10-calico.conflist
  12. state: absent
  13. - name: Calico | delete calico-node docker containers
  14. shell: "{{ docker_bin_dir }}/docker ps -af name=k8s_POD_calico-node* -q | xargs --no-run-if-empty {{ docker_bin_dir }}/docker rm -f"
  15. register: docker_calico_node_remove
  16. until: docker_calico_node_remove is succeeded
  17. retries: 5
  18. when: container_manager in ["docker"]
  19. - name: Calico | delete calico-node crio/containerd containers
  20. 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 %"'
  21. register: crictl_calico_node_remove
  22. until: crictl_calico_node_remove is succeeded
  23. retries: 5
  24. when: container_manager in ["crio", "containerd"]