diff options
-rw-r--r-- | cloudinit/config/cc_lxd.py | 7 |
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")) |