2018-08-16 23:34:33 +08:00
|
|
|
---
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: "Reset | check if network device {{ iface }} is present"
|
2018-08-16 23:34:33 +08:00
|
|
|
stat:
|
|
|
|
path: "/sys/class/net/{{ iface }}"
|
2021-02-10 21:36:59 +08:00
|
|
|
get_attributes: no
|
|
|
|
get_checksum: no
|
|
|
|
get_mime: no
|
2018-08-16 23:34:33 +08:00
|
|
|
register: device_remains
|
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: "Reset | remove network device {{ iface }}"
|
2018-08-16 23:34:33 +08:00
|
|
|
command: "ip link del {{ iface }}"
|
|
|
|
when: device_remains.stat.exists
|