Reset tasks specific to a network_plugin moved inside its role directory + Reset tasks specific to cilium

This commit is contained in:
Erwan Miran
2018-08-16 17:34:33 +02:00
parent 58ee5f1cc9
commit 7f16b46ed5
4 changed files with 40 additions and 26 deletions

View File

@@ -0,0 +1,9 @@
---
- name: reset | check and remove devices if still present
include_tasks: reset_iface.yml
vars:
iface: "{{ item }}"
with_items:
- cilium_host
- cilium_net
- cilium_vxlan

View File

@@ -0,0 +1,9 @@
---
- name: "reset | check if network device {{ iface }} is present"
stat:
path: "/sys/class/net/{{ iface }}"
register: device_remains
- name: "reset | remove network device {{ iface }}"
command: "ip link del {{ iface }}"
when: device_remains.stat.exists

View File

@@ -0,0 +1,18 @@
---
- name: reset | check cni network device
stat:
path: /sys/class/net/cni0
register: cni
- name: reset | remove the network device created by the flannel
command: ip link del cni0
when: cni.stat.exists
- name: reset | check flannel network device
stat:
path: /sys/class/net/flannel.1
register: flannel
- name: reset | remove the network device created by the flannel
command: ip link del flannel.1
when: flannel.stat.exists