diff options
author | Nik Lutz <nik@netstyle.ch> | 2016-05-18 16:20:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2016-05-18 18:26:07 +0000 |
commit | cfe08b9c7149a5dc1b70d665ce918cede8e484ba (patch) | |
tree | 32a7d9edee28eed1874ce1374235749dcbfc0137 /share | |
parent | Using eth[0-9] instead of host[0-9] in containers /etc/network/interface. (diff) | |
download | compute-tools-cfe08b9c7149a5dc1b70d665ce918cede8e484ba.tar.xz compute-tools-cfe08b9c7149a5dc1b70d665ce918cede8e484ba.zip |
Replacing systemd-nspawn '--network-bridge=' with one config file per interface in /etc/network/interfaces.d.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'share')
-rw-r--r-- | share/config/container.conf.in | 2 | ||||
-rwxr-xr-x | share/scripts/debconf | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/share/config/container.conf.in b/share/config/container.conf.in index f7d01be..5ea342a 100644 --- a/share/config/container.conf.in +++ b/share/config/container.conf.in @@ -2,6 +2,7 @@ [start] cnt.autostart=@CNT_AUTOSTART@ +cnt.network-bridge=@CNT_NETWORK_BRIDGE@ bind=@BIND@ boot=@BOOT@ capability=@CAPABILITY@ @@ -9,7 +10,6 @@ directory=@DIRECTORY@ drop-capability=@DROP_CAPABILITY@ machine=@MACHINE@ network-veth-extra=@NETWORK_VETH_EXTRA@ -network-bridge=@NETWORK_BRIDGE@ link-journal=@LINK_JOURNAL@ register=@REGISTER@ diff --git a/share/scripts/debconf b/share/scripts/debconf index bbdd65c..3bacbeb 100755 --- a/share/scripts/debconf +++ b/share/scripts/debconf @@ -902,12 +902,12 @@ Commands () fi # config (FIXME) - sed -i -e "s|^network-bridge=.*|network-bridge=${NETWORK0_BRIDGE}|" "${CONFIG}/${NAME}.conf" # maximum of 15 characters, prefix is 'veth-' HOSTNAME_SHORT="$(echo ${NAME} | cut -c-8)" HOST_INTERFACE_NAME="$(echo ${NETWORK0_VETH:-veth-${HOSTNAME_SHORT}-0})" + sed -i -e "s|^cnt.network-bridge=.*|cnt.network-bridge=${HOST_INTERFACE_NAME}:${NETWORK0_BRIDGE:-br0}|g" "${CONFIG}/${NAME}.conf" sed -i -e "s|^network-veth-extra=.*|network-veth-extra=${HOST_INTERFACE_NAME}:eth0|g" "${CONFIG}/${NAME}.conf" for NUMBER in $(seq 1 ${NETWORK_NUMBER}) @@ -925,6 +925,9 @@ Commands () CONTAINER_INTERFACE_NAME="eth${NUMBER}" sed -i -e "/^register=.*/ a network-veth-extra=${HOST_INTERFACE_NAME}:${CONTAINER_INTERFACE_NAME}" "${CONFIG}/${NAME}.conf" + + eval BRIDGE="$`echo NETWORK${NUMBER}_BRIDGE`" + sed -i -e "/^register=.*/ a cnt.network-bridge=${HOST_INTERFACE_NAME}:${BRIDGE:-br${NUMBER}}" "${CONFIG}/${NAME}.conf" done # Setting root password |