Ensure container network type is defaulted to veth
Update the lxc template files to properly default to 'veth' when the container_type is undefined within a user's deployment configuration. Change-Id: I5c8b1e10e91660fccc743c430f49133615e60060
This commit is contained in:
parent
35cb314429
commit
5c2a77fc28
|
@ -4,7 +4,7 @@
|
|||
lxc.network.type = {{ item.value.type|default('veth') }}
|
||||
# Network device within the container
|
||||
lxc.network.name = {{ item.value.interface }}
|
||||
{% if item.value.type == 'veth' or item.value.type is none %}
|
||||
{% if item.value.type is not defined or item.value.type == 'veth' %}
|
||||
# Name the veth after the container
|
||||
# NOTE(major): The lxc.network.veth.pair line must appear right after
|
||||
# lxc.network.name or it will be ignored.
|
||||
|
|
|
@ -8,7 +8,7 @@ logger "LXC container {{ inventory_hostname }} removing veth {{ inventory_hostna
|
|||
|
||||
# Veth cleanup for items in the container_networks data structure
|
||||
{% for key, value in container_networks.items() %}
|
||||
{% if value.type == 'veth' or value.type is none %}
|
||||
{% if value.type is not defined or value.type == 'veth' %}
|
||||
ip link del {{ inventory_hostname[-8:].replace('-', '').replace('_', '') }}_{{ value.interface }} || true
|
||||
logger "LXC container {{ inventory_hostname }} removing veth {{ inventory_hostname[-8:].replace('-', '').replace('_', '') }}_{{ value.interface }}"
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue