diff options
author | Manuel Buil <mbuil@suse.com> | 2019-03-19 16:10:53 +0100 |
---|---|---|
committer | Manuel Buil <mbuil@suse.com> | 2019-03-25 13:33:09 +0000 |
commit | 49c5a0c6c23b107137540616a6342058432aeb3f (patch) | |
tree | c485efefc929f59cc78009422f7434c4c8126b89 /xci/playbooks/roles/bootstrap-host/tasks | |
parent | 4993f06aadf49169cb7fc9917ba475c3d015a9ab (diff) |
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 <mbuil@suse.com>
Diffstat (limited to 'xci/playbooks/roles/bootstrap-host/tasks')
-rw-r--r-- | xci/playbooks/roles/bootstrap-host/tasks/network_debian.yml | 2 |
1 files changed, 1 insertions, 1 deletions
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: |