Skip to content

Commit 4bdcfba

Browse files
committed
Fixes for "restart devices" task
fixes #8
1 parent 8a6b4aa commit 4bdcfba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tasks/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@
6565
- network-interfaces-remove-configurations
6666

6767
- name: restart devices
68-
service:
69-
name: "{{ network_interfaces_service }}"
70-
state: restarted
71-
arguments: "INTERFACE={{ item.item.device }}"
68+
shell: >
69+
[ -n "$(ifquery --list --exclude=lo)" ] && udevadm settle
70+
&& ip addr flush {{ item.item.device }}
71+
&& (ifdown {{ item.item.device }} --exclude=lo || true) && ifup {{ item.item.device }} --exclude=lo
7272
when: item.changed and item.item.auto | default(true)
7373
with_items: "{{ _network_interfaces_configuration_result.results | default([]) }}"
7474
tags:

0 commit comments

Comments
 (0)