Pārlūkot izejas kodu

Merge "Add ability to configure VLAN tag on patch port"

pull/121/merge
Ondrej Smola pirms 6 gadiem
vecāks
revīzija
792316452f
3 mainītis faili ar 58 papildinājumiem un 0 dzēšanām
  1. +2
    -0
      README.rst
  2. +7
    -0
      linux/network/interface.sls
  3. +49
    -0
      tests/pillar/network_openvswitch.sls

+ 2
- 0
README.rst Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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

Notiek ielāde…
Atcelt
Saglabāt