瀏覽代碼

added persistent cfg for native ovn bond

pull/188/head
Tomas Pipota 6 年之前
父節點
當前提交
0258764491
共有 5 個文件被更改,包括 23 次插入1 次删除
  1. +1
    -0
      README.rst
  2. +4
    -0
      linux/files/ovs_bridge
  3. +4
    -0
      linux/files/ovs_port
  4. +13
    -1
      linux/network/interface.sls
  5. +1
    -0
      tests/pillar/network_openvswitch.sls

+ 1
- 0
README.rst 查看文件

@@ -1471,6 +1471,7 @@ Open vSwitch Bridges:
enabled: true
name: br-ens7
type: ovs_bridge
ovs_ports: ens7
proto: manual
mtu: 9000
use_interfaces:

+ 4
- 0
linux/files/ovs_bridge 查看文件

@@ -9,6 +9,10 @@ netmask {{ bridge.netmask }}
{%- if bridge.gateway is defined %}
gateway {{ bridge.gateway }}
{%- endif %}
{%- if bridge.ovs_ports is defined %}
ovs_ports {{ bridge.ovs_ports }}
{%- endif %}
{%- if bridge.ovs_options is defined %}
ovs_options {{ bridge.ovs_options }}
{%- endif %}


+ 4
- 0
linux/files/ovs_port 查看文件

@@ -11,6 +11,10 @@ netmask {{ port.netmask }}
{%- if port.gateway is defined %}
gateway {{ port.gateway }}
{%- endif %}
{%- if port.slaves is defined %}
ovs_bonds {{ port.slaves }}
{%- endif %}
{%- if port.ovs_options is defined %}
ovs_options {{ port.ovs_options }}
{%- endif %}


+ 13
- 1
linux/network/interface.sls 查看文件

@@ -152,7 +152,7 @@ linux_interfaces_include_{{ interface_name }}:
source /etc/network/interfaces.u/*

ovs_bridge_{{ interface_name }}:
file.managed:
file.append:
- name: /etc/network/interfaces.u/ifcfg-{{ interface_name }}
- makedirs: True
- source: salt://linux/files/ovs_bridge
@@ -176,6 +176,18 @@ ovs_bond_{{ interface_name }}:
- require:
- ovs_bridge_{{ interface.bridge }}_present

ovs_bond_persistent_{{ interface_name }}:
file.append:
- name: /etc/network/interfaces.u/ifcfg-{{ interface.bridge }}
- makedirs: True
- source: salt://linux/files/ovs_port
- template: jinja
- context:
port_name: {{ interface_name }}
port: {{ interface|yaml }}
- require:
- ovs_bridge_{{ interface.bridge }}

{%- elif interface.type == 'ovs_port' %}

{%- if interface.get('port_type','internal') == 'patch' %}

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

@@ -18,6 +18,7 @@ linux:
enabled: true
type: ovs_bridge
proto: manual
ovs_ports: ens0
mtu: 9000
use_interfaces:
- ens0

Loading…
取消
儲存