aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/patches/0007-network.interface-Fix-ifup-OVS-port-with-route.patch
blob: 2a5e29e9e35663d3f49c30a9615a86394773a624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: 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
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Sun, 31 Dec 2017 16:06:30 +0100
Subject: [PATCH] network.interface: Fix ifup OVS port with route

This change attempts to fix the following sequence for nodes with
OVS ports that also have routes defined:
- state.sls linux.network; system.reboot; state.sls linux.network;

If an OVS port also has a route defined, a route cfg file is
created in </etc/network/if.{down,up}.d/>, which is sourced after
system reboot before we (eventually) re-run `interface.sls`, leaving
the OVS port in UP state, so `ifup` would fail.

Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
 linux/network/interface.sls | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/linux/network/interface.sls b/linux/network/interface.sls
index 921ceac..3bba64e 100644
--- a/linux/network/interface.sls
+++ b/linux/network/interface.sls
@@ -146,6 +146,8 @@ ovs_port_up_{{ interface_name }}:
     - file: ovs_port_{{ interface_name }}_line2
     - openvswitch_bridge: ovs_bridge_{{ interface.bridge }}
     - file: linux_interfaces_final_include
+  - unless:
+    - ip link show {{ interface_name }} | grep -q '\<UP\>'

 {%- endif %}