Allow to create OVS bridge for lxcbr0
This patch aims to handle creation of OVS bridge if `lxc_net_bridge_type` is set to `openvswitch`. That will finalize path when deployer prefers to have OVS as the only bridge provider and do not use LXB for any bridges. Change-Id: Idd7a6eecf718df7fd8b4ae008f7dc00e42e8c32c
This commit is contained in:
parent
97a3e26e01
commit
db7c1e8a7c
@ -100,7 +100,8 @@ lxc_net_managed: true
|
|||||||
|
|
||||||
# lxc container net network
|
# lxc container net network
|
||||||
lxc_net_bridge: lxcbr0
|
lxc_net_bridge: lxcbr0
|
||||||
lxc_net_bridge_port: none
|
# Can be 'linuxbridge' or 'openvswitch'
|
||||||
|
lxc_net_bridge_type: linuxbridge
|
||||||
lxc_net_address: 10.0.3.1
|
lxc_net_address: 10.0.3.1
|
||||||
lxc_net_netmask: 255.255.255.0
|
lxc_net_netmask: 255.255.255.0
|
||||||
lxc_net_cidr: 24
|
lxc_net_cidr: 24
|
||||||
|
@ -54,13 +54,18 @@
|
|||||||
tags:
|
tags:
|
||||||
- lxc-net
|
- lxc-net
|
||||||
|
|
||||||
|
- name: Setup LXC OVS Bridge
|
||||||
|
openvswitch_bridge:
|
||||||
|
bridge: "{{ lxc_net_bridge }}"
|
||||||
|
fail_mode: standalone
|
||||||
|
state: present
|
||||||
|
when: lxc_net_bridge_type == 'openvswitch'
|
||||||
|
|
||||||
- name: Run the systemd-networkd role
|
- name: Run the systemd-networkd role
|
||||||
include_role:
|
include_role:
|
||||||
name: systemd_networkd
|
name: systemd_networkd
|
||||||
vars:
|
vars:
|
||||||
systemd_networkd_prefix: "lxc-net"
|
_lxc_net_bridge_devices:
|
||||||
systemd_run_networkd: true
|
|
||||||
systemd_netdevs:
|
|
||||||
- NetDev:
|
- NetDev:
|
||||||
Name: "{{ lxc_net_bridge }}"
|
Name: "{{ lxc_net_bridge }}"
|
||||||
Kind: bridge
|
Kind: bridge
|
||||||
@ -69,6 +74,9 @@
|
|||||||
HelloTimeSec: 2
|
HelloTimeSec: 2
|
||||||
MaxAgeSec: 12
|
MaxAgeSec: 12
|
||||||
STP: off
|
STP: off
|
||||||
|
systemd_networkd_prefix: "lxc-net"
|
||||||
|
systemd_run_networkd: true
|
||||||
|
systemd_netdevs: "{{ (lxc_net_bridge_type == 'openvswitch') | ternary([], _lxc_net_bridge_devices) }}"
|
||||||
systemd_networks:
|
systemd_networks:
|
||||||
- interface: "{{ lxc_net_bridge }}"
|
- interface: "{{ lxc_net_bridge }}"
|
||||||
address: "{{ lxc_net_address }}"
|
address: "{{ lxc_net_address }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user