enabled: true | enabled: true | ||||
name: br-ens7 | name: br-ens7 | ||||
type: ovs_bridge | type: ovs_bridge | ||||
ovs_ports: ens7 | |||||
proto: manual | proto: manual | ||||
mtu: 9000 | mtu: 9000 | ||||
use_interfaces: | use_interfaces: |
{%- if bridge.gateway is defined %} | {%- if bridge.gateway is defined %} | ||||
gateway {{ bridge.gateway }} | gateway {{ bridge.gateway }} | ||||
{%- endif %} | {%- endif %} | ||||
{%- if bridge.ovs_ports is defined %} | |||||
ovs_ports {{ bridge.ovs_ports }} | |||||
{%- endif %} | |||||
{%- if bridge.ovs_options is defined %} | {%- if bridge.ovs_options is defined %} | ||||
ovs_options {{ bridge.ovs_options }} | ovs_options {{ bridge.ovs_options }} | ||||
{%- endif %} | {%- endif %} | ||||
{%- if port.gateway is defined %} | {%- if port.gateway is defined %} | ||||
gateway {{ port.gateway }} | gateway {{ port.gateway }} | ||||
{%- endif %} | {%- endif %} | ||||
{%- if port.slaves is defined %} | |||||
ovs_bonds {{ port.slaves }} | |||||
{%- endif %} | |||||
{%- if port.ovs_options is defined %} | {%- if port.ovs_options is defined %} | ||||
ovs_options {{ port.ovs_options }} | ovs_options {{ port.ovs_options }} | ||||
{%- endif %} | {%- endif %} | ||||
source /etc/network/interfaces.u/* | source /etc/network/interfaces.u/* | ||||
ovs_bridge_{{ interface_name }}: | ovs_bridge_{{ interface_name }}: | ||||
file.managed: | |||||
file.append: | |||||
- name: /etc/network/interfaces.u/ifcfg-{{ interface_name }} | - name: /etc/network/interfaces.u/ifcfg-{{ interface_name }} | ||||
- makedirs: True | - makedirs: True | ||||
- source: salt://linux/files/ovs_bridge | - source: salt://linux/files/ovs_bridge | ||||
- require: | - require: | ||||
- ovs_bridge_{{ interface.bridge }}_present | - 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' %} | {%- elif interface.type == 'ovs_port' %} | ||||
{%- if interface.get('port_type','internal') == 'patch' %} | {%- if interface.get('port_type','internal') == 'patch' %} |
enabled: true | enabled: true | ||||
type: ovs_bridge | type: ovs_bridge | ||||
proto: manual | proto: manual | ||||
ovs_ports: ens0 | |||||
mtu: 9000 | mtu: 9000 | ||||
use_interfaces: | use_interfaces: | ||||
- ens0 | - ens0 |