diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2018-02-23 22:10:33 +0100 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2018-02-25 23:44:22 +0100 |
commit | ebbd37dfb0605db89e84229fd891aa0cd141d1b0 (patch) | |
tree | 98bd6625e73caa5d0f5e4af29150827ed1650472 /mcp/salt-formulas/opnfv/route_wrapper.sls | |
parent | f80d30f56b5de482c2212c72808c04f72940a6d3 (diff) |
[ovs/dpdk] Add opnfv.route_wrapper sls
- fix `route-br-ex` if-up.d script failing when route already exists
by adding a wrapper around distro's '/sbin/route' binary in
'/usr/local/sbin/route', exploiting default order in Ubuntu PATH;
- fix 'br-prv' duplicate entry in 'interfaces.d/ifcfg-br-prv' and
'interfaces' caused by upstream bug [1];
- add barrier waiting for all baremetal nodes online before attempting
reboot, trying to catch rare failures which are undetectable in logs
as both a succesful reboot and a disconneted minion report 'n/c';
With the above in place, networking service should no longer fail
to start on cmp nodes w/ DPDK.
[1] https://github.com/saltstack/salt/issues/40262
Change-Id: I6d4895376ce323c14c997e6c9af2ea3eeeee0184
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'mcp/salt-formulas/opnfv/route_wrapper.sls')
-rw-r--r-- | mcp/salt-formulas/opnfv/route_wrapper.sls | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/mcp/salt-formulas/opnfv/route_wrapper.sls b/mcp/salt-formulas/opnfv/route_wrapper.sls new file mode 100644 index 000000000..6132f317e --- /dev/null +++ b/mcp/salt-formulas/opnfv/route_wrapper.sls @@ -0,0 +1,27 @@ +############################################################################## +# Copyright (c) 2018 Mirantis Inc., Enea AB and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +/usr/local/sbin/route: + file.managed: + - contents: | + #!/bin/sh + + # Workaround salt-managed routes breaking ifup when route already exists + route_binary='/sbin/route' + route_output=$("${route_binary}" "$@" 2>&1) + route_return=$? + + if [ -n "${route_output}" ]; then + if echo "${route_output}" | grep -q 'SIOCADDRT: File exists'; then + exit 0 + fi + echo "${route_output}" + fi + exit "${route_return}" + - user: root + - group: root + - mode: 755 |