From 49c5a0c6c23b107137540616a6342058432aeb3f Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Tue, 19 Mar 2019 16:10:53 +0100 Subject: Bug fix: don't force rc=0 on first command When working with an interface that uses vlan, the vlan is created when executing the ifup command. As we previously execute the command: /sbin/ip addr flush dev {{ item }} it will not return code 0 because the interface does not exist yet. Consequently, the second part of the command (ifup) is never executed and the new network config is never triggered. This patch removes the requirement to get a rc=0 in the first command to run the second one. Note that /sbin/ip addr flush dev {{ item }} must be run before ifup when working with non-vlan interfaces that already have an ip, otherwise ifup fails in Ubuntu Change-Id: Ieac273a49b78104f24d4c1ba81c263b450a40a9f Signed-off-by: Manuel Buil --- xci/playbooks/roles/bootstrap-host/tasks/network_debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xci') diff --git a/xci/playbooks/roles/bootstrap-host/tasks/network_debian.yml b/xci/playbooks/roles/bootstrap-host/tasks/network_debian.yml index 46f6e81f..176c7eb1 100644 --- a/xci/playbooks/roles/bootstrap-host/tasks/network_debian.yml +++ b/xci/playbooks/roles/bootstrap-host/tasks/network_debian.yml @@ -90,7 +90,7 @@ - "'opnfv' in inventory_hostname" - name: restart network service - shell: "/sbin/ip addr flush dev {{ item }} && /sbin/ifdown -a && /sbin/ifup -a" + shell: "/sbin/ip addr flush dev {{ item }}; /sbin/ifdown -a; /sbin/ifup -a" async: 15 poll: 0 with_items: -- cgit 1.2.3-korg