Ver código fonte

added persistent cfg for native ovn bond

pull/188/head
Tomas Pipota 6 anos atrás
pai
commit
0258764491
5 arquivos alterados com 23 adições e 1 exclusões
  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 Ver arquivo

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

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

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

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

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

Carregando…
Cancelar
Salvar