From: Manuel Buil Date: Tue, 19 Mar 2019 15:10:53 +0000 (+0100) Subject: Bug fix: don't force rc=0 on first command X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=49c5a0c6c23b107137540616a6342058432aeb3f;p=releng-xci.git 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 --- 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: