瀏覽代碼

Add ability to configure VLAN tag on patch port

Change-Id: I41f6e9c4feed93d03ac0479f9bd3626e48ad8063
Co-Authored-By: Michael Polenchuk <mpolenchuk@mirantis.com>
Closes-Bug: PROD-20729
pull/121/merge
Oleksii Chupryn 6 年之前
父節點
當前提交
694ee72f51
共有 3 個文件被更改,包括 58 次插入0 次删除
  1. +2
    -0
      README.rst
  2. +7
    -0
      linux/network/interface.sls
  3. +49
    -0
      tests/pillar/network_openvswitch.sls

+ 2
- 0
README.rst 查看文件

@@ -1146,6 +1146,7 @@ OpenVswitch Bridges
bridge: br-ens7
port_type: patch
peer: prv-ens7
tag: 109 # [] to unset a tag
mtu: 65000
patch-br-prv-br-ens7:
enabled: true
@@ -1155,6 +1156,7 @@ OpenVswitch Bridges
type: ovs_port
port_type: patch
peer: ens7-prv
tag: 109
mtu: 65000
ens7:
enabled: true

+ 7
- 0
linux/network/interface.sls 查看文件

@@ -133,6 +133,13 @@ ovs_port_set_peer_{{ interface_name }}:
- name: ovs-vsctl{%- if network.ovs_nowait %} --no-wait{%- endif %} set interface {{ interface_name }} options:peer={{ interface.peer }}
- unless: ovs-vsctl show | grep -A 2 'Interface {{ interface_name }}' | grep {{ interface.peer }}

{% if interface.tag is defined %}
ovs_port_set_tag_{{ interface_name }}:
cmd.run:
- name: ovs-vsctl{%- if network.ovs_nowait %} --no-wait{%- endif %} set port {{ interface_name }} tag={{ interface.tag }}
- unless: ovs-vsctl get Port {{ interface_name }} tag | grep -Fx {{ interface.tag }}
{%- endif %}

{%- else %}

linux_interfaces_include_{{ interface_name }}:

+ 49
- 0
tests/pillar/network_openvswitch.sls 查看文件

@@ -0,0 +1,49 @@
linux:
system:
enabled: true
domain: local
network:
enabled: true
hostname: test01
fqdn: test01.local
network_manager: false
bridge: openvswitch
interface:
br-prv:
enabled: true
type: ovs_bridge
mtu: 65000
br-ens0:
enabled: true
type: ovs_bridge
proto: manual
mtu: 9000
use_interfaces:
- ens0
patch-br-ens0-br-prv:
enabled: true
name: ens0-prv
ovs_type: ovs_port
type: ovs_port
bridge: br-ens0
port_type: patch
peer: prv-ens0
tag: 107
mtu: 65000
patch-br-prv-br-ens0:
enabled: true
name: prv-ens0
bridge: br-prv
ovs_type: ovs_port
type: ovs_port
port_type: patch
peer: ens0-prv
tag: 107
mtu: 65000
ens0:
enabled: true
proto: manual
ovs_port_type: OVSPort
type: ovs_port
ovs_bridge: br-ens0
bridge: br-ens0

Loading…
取消
儲存