diff --git a/roles/network_plugin/canal/handlers/main.yml b/roles/network_plugin/canal/handlers/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..7769b99b3c7e41a261ddeed1cd467401d5d577b0 --- /dev/null +++ b/roles/network_plugin/canal/handlers/main.yml @@ -0,0 +1,14 @@ +--- +- name: reset_canal_cni + command: /bin/true + notify: + - delete 10-canal.conflist + - delete canal-node containers + +- name: delete 10-canal.conflist + file: + path: /etc/canal/10-canal.conflist + state: absent + +- name: delete canal-node containers + shell: "docker ps -af name=k8s_POD_canal-node* -q | xargs --no-run-if-empty docker rm -f" diff --git a/roles/network_plugin/canal/tasks/main.yml b/roles/network_plugin/canal/tasks/main.yml index 3de079b5f55367f34a0ea3d55e176bec79584fc7..7595a2a759bf4ba6861448c61282049a227a0033 100644 --- a/roles/network_plugin/canal/tasks/main.yml +++ b/roles/network_plugin/canal/tasks/main.yml @@ -4,6 +4,8 @@ src: "cni-canal.conflist.j2" dest: "/etc/cni/net.d/{% if calico_version is version('v3.3.0', '>=') %}canal.conflist.template{% else %}10-canal.conflist{% endif %}" owner: kube + register: canal_conflist + notify: reset_canal_cni - name: Canal | Create canal certs directory file: