Handle noifupdown option for all cmd.run states
with explicit ifup call as well.
Change-Id: Ie855a0810bcfe4a856cf9d29bd0755643d71ff4d
Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-: Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+: Copyright (c) 2019 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
:
: All rights reserved. This program and the accompanying materials
: are made available under the terms of the Apache License, Version 2.0
Date: Wed, 28 Feb 2018 17:54:28 +0400
Subject: [PATCH] Set ovs bridges as L3 interfaces
Date: Wed, 28 Feb 2018 17:54:28 +0400
Subject: [PATCH] Set ovs bridges as L3 interfaces
-Change-Id: I1e83129cc184cf481bea21d7aa452bf60d9e0499
----
- linux/files/ovs_bridge | 18 ++++++++++++++++++
- linux/files/ovs_port | 7 ++++++-
- linux/network/interface.sls | 28 ++++++++++++++++++++++++++++
- 3 files changed, 52 insertions(+), 1 deletion(-)
- create mode 100644 linux/files/ovs_bridge
-
diff --git a/linux/files/ovs_bridge b/linux/files/ovs_bridge
new file mode 100644
index 0000000..d33864c
diff --git a/linux/files/ovs_bridge b/linux/files/ovs_bridge
new file mode 100644
index 0000000..d33864c
mtu {{ port.get('mtu', '1500') }}
ovs_bridge {{ port.bridge }}
diff --git a/linux/network/interface.sls b/linux/network/interface.sls
mtu {{ port.get('mtu', '1500') }}
ovs_bridge {{ port.bridge }}
diff --git a/linux/network/interface.sls b/linux/network/interface.sls
-index a39fc37..b76c5d6 100644
+index a39fc37..c4a94a3 100644
--- a/linux/network/interface.sls
+++ b/linux/network/interface.sls
--- a/linux/network/interface.sls
+++ b/linux/network/interface.sls
-@@ -92,6 +92,34 @@ add_int_{{ int_name }}_to_ovs_dpdk_bridge_{{ interface_name }}:
+@@ -92,6 +92,37 @@ add_int_{{ int_name }}_to_ovs_dpdk_bridge_{{ interface_name }}:
ovs_bridge_{{ interface_name }}:
openvswitch_bridge.present:
- name: {{ interface_name }}
ovs_bridge_{{ interface_name }}:
openvswitch_bridge.present:
- name: {{ interface_name }}
+ - file: ovs_bridge_{{ interface_name }}
+ - openvswitch_bridge: ovs_bridge_{{ interface_name }}
+ - file: linux_interfaces_final_include
+ - file: ovs_bridge_{{ interface_name }}
+ - openvswitch_bridge: ovs_bridge_{{ interface_name }}
+ - file: linux_interfaces_final_include
-+ - unless:
-+ - ip link show {{ interface_name }} | grep -q '\<UP\>'
++ {%- if network.noifupdown|d(false) or interface.noifupdown|d(false) %}
++ - onlyif: /bin/false
++ {%- else %}
++ - unless: ip link show {{ interface_name }} | grep -q '\<UP\>'
++ {%- endif %}
+{%- endif %}
{# add linux network interface into OVS bridge #}
{%- for int_name, int in network.interface.items() %}
+{%- endif %}
{# add linux network interface into OVS bridge #}
{%- for int_name, int in network.interface.items() %}
+@@ -176,6 +207,9 @@ ovs_port_{{ interface_name }}_line2:
+ ovs_port_up_{{ interface_name }}:
+ cmd.run:
+ - name: ifup {{ interface_name }}
++ {%- if network.noifupdown|d(false) or interface.noifupdown|d(false) %}
++ - onlyif: /bin/false
++ {%- endif %}
+ - require:
+ - file: ovs_port_{{ interface_name }}
+ - file: ovs_port_{{ interface_name }}_line1