Merge "Remove ovs from dpdk bridge config"
diff --git a/linux/network/dpdk.sls b/linux/network/dpdk.sls
index 7cc4102..c400831 100644
--- a/linux/network/dpdk.sls
+++ b/linux/network/dpdk.sls
@@ -141,7 +141,45 @@
linux_network_dpdk_bridge_interface_{{ interface_name }}:
cmd.run:
- name: "ovs-vsctl{%- if network.ovs_nowait %} --no-wait{%- endif %} add-br {{ interface_name }} -- set bridge {{ interface_name }} datapath_type=netdev{% if interface.tag is defined %} -- set port {{ interface_name }} tag={{ interface.tag }}{% endif %}"
- - unless: "ovs-vsctl show | grep {{ interface_name }}"
+ - unless: 'ovs-vsctl show | grep "Bridge {{ interface_name }}"'
+
+ {# OVS dpdk needs ip address for vxlan termination on bridge br-prv #}
+ {%- if interface.address is defined %}
+
+{# create override for openvswitch dependency for dpdk br-prv #}
+/etc/systemd/system/ifup@{{ interface_name }}.service.d/override.conf:
+ file.managed:
+ - makedirs: true
+ - require:
+ - cmd: linux_network_dpdk_bridge_interface_{{ interface_name }}
+ - contents: |
+ [Unit]
+ Requires=openvswitch-switch.service
+ After=openvswitch-switch.service
+
+{# enforce ip address and mtu for ovs dpdk br-prv #}
+dpdk_ovs_bridge_{{ interface_name }}:
+ file.managed:
+ - name: /etc/network/interfaces.u/ifcfg-{{ interface_name }}
+ - contents: |
+ auto {{ interface_name }}
+ iface {{ interface_name }} inet static
+ address {{ interface.address }}
+ netmask {{ interface.netmask }}
+ {%- if interface.mtu is defined %}
+ mtu {{ interface.mtu }}
+ {%- endif %}
+ - makedirs: True
+ - require:
+ - file: /etc/systemd/system/ifup@{{ interface_name }}.service.d/override.conf
+
+dpdk_ovs_bridge_up_{{ interface_name }}:
+ cmd.run:
+ - name: ifup {{ interface_name }}
+ - require:
+ - file: dpdk_ovs_bridge_{{ interface_name }}
+
+ {%- endif %}
{%- elif interface.type == 'dpdk_ovs_port' and interface.bridge is defined %}
diff --git a/linux/network/interface.sls b/linux/network/interface.sls
index 65e7bb8..40d02bb 100644
--- a/linux/network/interface.sls
+++ b/linux/network/interface.sls
@@ -82,43 +82,6 @@
- name: ovs-vsctl{%- if network.ovs_nowait %} --no-wait{%- endif %} add-port {{ interface_name }} {{ int_name }}
{%- endif %}
{%- endfor %}
-
-linux_interfaces_include_{{ interface_name }}:
- file.prepend:
- - name: /etc/network/interfaces
- - text: |
- source /etc/network/interfaces.d/*
- # Workaround for Upstream-Bug: https://github.com/saltstack/salt/issues/40262
- source /etc/network/interfaces.u/*
-
-{# create override for openvswitch dependency for dpdk br-prv #}
-/etc/systemd/system/ifup@{{ interface_name }}.service.d/override.conf:
- file.managed:
- - makedirs: true
- - require:
- - cmd: linux_network_dpdk_bridge_interface_{{ interface_name }}
- - contents: |
- [Unit]
- Requires=openvswitch-switch.service
- After=openvswitch-switch.service
-
-dpdk_ovs_bridge_{{ interface_name }}:
- file.managed:
- - name: /etc/network/interfaces.u/ifcfg-{{ interface_name }}
- - makedirs: True
- - source: salt://linux/files/ovs_bridge
- - defaults:
- bridge: {{ interface|yaml }}
- bridge_name: {{ interface_name }}
- - template: jinja
-
-dpdk_ovs_bridge_up_{{ interface_name }}:
- cmd.run:
- - name: ifup {{ interface_name }}
- - require:
- - file: dpdk_ovs_bridge_{{ interface_name }}
- - file: linux_interfaces_final_include
-
{%- endif %}
{# it is not used for any interface with type preffix dpdk,eg. dpdk_ovs_port #}