Browse Source

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 years ago
parent
commit
694ee72f51
3 changed files with 58 additions and 0 deletions
  1. +2
    -0
      README.rst
  2. +7
    -0
      linux/network/interface.sls
  3. +49
    -0
      tests/pillar/network_openvswitch.sls

+ 2
- 0
README.rst View File

bridge: br-ens7 bridge: br-ens7
port_type: patch port_type: patch
peer: prv-ens7 peer: prv-ens7
tag: 109 # [] to unset a tag
mtu: 65000 mtu: 65000
patch-br-prv-br-ens7: patch-br-prv-br-ens7:
enabled: true enabled: true
type: ovs_port type: ovs_port
port_type: patch port_type: patch
peer: ens7-prv peer: ens7-prv
tag: 109
mtu: 65000 mtu: 65000
ens7: ens7:
enabled: true enabled: true

+ 7
- 0
linux/network/interface.sls View File

- name: ovs-vsctl{%- if network.ovs_nowait %} --no-wait{%- endif %} set interface {{ interface_name }} options:peer={{ interface.peer }} - 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 }} - 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 %} {%- else %}


linux_interfaces_include_{{ interface_name }}: linux_interfaces_include_{{ interface_name }}:

+ 49
- 0
tests/pillar/network_openvswitch.sls View File

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…
Cancel
Save