Merge "[baremetal] heat: Switch metadata API URL to mgmt"
[fuel.git] / mcp / patches / 0007-network.interface-Fix-ifup-OVS-port-with-route.patch
1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2017 Mirantis Inc., Enea AB and others.
3 :
4 : All rights reserved. This program and the accompanying materials
5 : are made available under the terms of the Apache License, Version 2.0
6 : which accompanies this distribution, and is available at
7 : http://www.apache.org/licenses/LICENSE-2.0
8 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
9 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
10 Date: Sun, 31 Dec 2017 16:06:30 +0100
11 Subject: [PATCH] network.interface: Fix ifup OVS port with route
12
13 This change attempts to fix the following sequence for nodes with
14 OVS ports that also have routes defined:
15 - state.sls linux.network; system.reboot; state.sls linux.network;
16
17 If an OVS port also has a route defined, a route cfg file is
18 created in </etc/network/if.{down,up}.d/>, which is sourced after
19 system reboot before we (eventually) re-run `interface.sls`, leaving
20 the OVS port in UP state, so `ifup` would fail.
21
22 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
23 ---
24  linux/network/interface.sls | 2 ++
25  1 file changed, 2 insertions(+)
26
27 diff --git a/linux/network/interface.sls b/linux/network/interface.sls
28 index 921ceac..3bba64e 100644
29 --- a/linux/network/interface.sls
30 +++ b/linux/network/interface.sls
31 @@ -146,6 +146,8 @@ ovs_port_up_{{ interface_name }}:
32      - file: ovs_port_{{ interface_name }}_line2
33      - openvswitch_bridge: ovs_bridge_{{ interface.bridge }}
34      - file: linux_interfaces_final_include
35 +  - unless:
36 +    - ip link show {{ interface_name }} | grep -q '\<UP\>'
37
38  {%- endif %}
39