summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorStéphane Graber <stgraber@ubuntu.com>2016-04-11 12:57:26 -0400
committerStéphane Graber <stgraber@ubuntu.com>2016-04-11 12:57:26 -0400
commitdcc2c894b9f12527ce0254fd7a0306e0d41af5bf (patch)
tree362407f93aa06e8dc1419c808029e7f26ae20507 /cloudinit
parent072510d7251653701c23ded9be38832044fb42b8 (diff)
downloadvyos-cloud-init-dcc2c894b9f12527ce0254fd7a0306e0d41af5bf.tar.gz
vyos-cloud-init-dcc2c894b9f12527ce0254fd7a0306e0d41af5bf.zip
lxd-bridge: Don't require a bridge name and implement support for domain name
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_lxd.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cloudinit/config/cc_lxd.py b/cloudinit/config/cc_lxd.py
index b467df20..0b10077a 100644
--- a/cloudinit/config/cc_lxd.py
+++ b/cloudinit/config/cc_lxd.py
@@ -138,7 +138,9 @@ def bridge_to_debconf(bridge_cfg):
elif bridge_cfg.get("mode") == "new":
debconf["lxd/setup-bridge"] = "true"
- debconf["lxd/bridge-name"] = bridge_cfg.get("name", "lxdbr0")
+ if bridge_cfg.get("name"):
+ debconf["lxd/bridge-name"] = bridge_cfg.get("name")
+
if bridge_cfg.get("ipv4_address"):
debconf["lxd/bridge-ipv4"] = "true"
debconf["lxd/bridge-ipv4-address"] = \
@@ -163,6 +165,9 @@ def bridge_to_debconf(bridge_cfg):
debconf["lxd/bridge-ipv6-nat"] = \
bridge_cfg.get("ipv6_nat", "false")
+ if bridge_cfg.get("domain"):
+ debconf["lxd/bridge-domain"] = bridge_cfg.get("domain")
+
else:
raise Exception("invalid bridge mode \"%s\"" % bridge_cfg.get("mode"))