diff --git a/cmdeploy/src/cmdeploy/lxc/cli.py b/cmdeploy/src/cmdeploy/lxc/cli.py index 98dfea04..eddd3b5e 100644 --- a/cmdeploy/src/cmdeploy/lxc/cli.py +++ b/cmdeploy/src/cmdeploy/lxc/cli.py @@ -114,7 +114,7 @@ def _lxc_start_cmd(args, out): ) sub.green(f" Include {ssh_cfg}") - # Optionally run cmdeploy run on each relay + # Optionally run cmdeploy run + dns on each relay if args.run: for ct in relays: with out.section(f"cmdeploy run: {ct.sname} ({ct.domain})"): @@ -123,6 +123,20 @@ def _lxc_start_cmd(args, out): out.red(f"Deploy to {ct.sname} failed (exit {ret})") return ret + with out.section("loading DNS zones"): + for ct in relays: + ret = _run_cmdeploy( + "dns", ct, ix, out, + extra=["--zonefile", str(ct.zone)], + ) + if ret: + out.red(f"DNS for {ct.sname} failed (exit {ret})") + return ret + if ct.zone.exists(): + dns_ct.set_dns_records(ct.zone.read_text()) + out.print(f"Restarting filtermail-incoming on {ct.name}") + ct.bash("systemctl restart filtermail-incoming") + # ------------------------------------------------------------------- # lxc-stop