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.

32 lines
1.1 KiB

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