4f1eb22919
The lxc_container_create role creates containers specified via an inventory. Multiple network interfaces can be added to a container during creation. These interfaces are provided by the task 'LXC host config for container networks' in openstack-ansible-lxc_container_create/tasks/container_create.yml The task 'LXC host config for container networks' utilizes a template file, openstack-ansible-lxc_container_create/templates/container-interface.ini.j2 The configuration for a specified interface is created using this template. The template currenlty offers the ability to modify the value 'lxc.network.type' which defaults to type 'veth' if no value is supplied. Supplying a value other than 'veth' is currently valid for this template. However, the creation of a veth pair device is hard coded into the template whether or not 'lxc.network.type' resolves to a value other than 'veth' This creates two unwanted side effects: First, a veth pair that is not being utilized by the corresponding container is created. We should not create a veth pair if it will not be used. Secondly, if the value of the variable 'lxc.network.link' defined in the same template file is something other than a bridge, the unwanted veth creation will fail resulting in a container that will not start. Additionally, if the corresponding veth pair is not created, then the template openstack-ansible-lxc_container_create/templates/veth-cleanup.sh.j2 should be modified to filter out interfaces that are not of type 'veth'. This change implements interface type detection in the template files veth-cleanup.sh.j2 and container-interface.ini.j2 to prevent creation of unwanted veth interfaces and their associated cleanup. Change-Id: I1c0a26d07e8de0ca862d21ea7b49e02ae447f83a Closes-Bug: #1531935 |
||
---|---|---|
.. | ||
autodev.j2 | ||
container-interface.ini.j2 | ||
veth-cleanup.sh.j2 |