Merge pull request 'Zerotier: make networkId nullable' (#4652) from install-fixing into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4652
This commit is contained in:
@@ -9,14 +9,7 @@
|
|||||||
let
|
let
|
||||||
controllerMachine = builtins.head (lib.attrNames roles.controller.machines or { });
|
controllerMachine = builtins.head (lib.attrNames roles.controller.machines or { });
|
||||||
networkIdPath = "${config.clan.core.settings.directory}/vars/per-machine/${controllerMachine}/zerotier/zerotier-network-id/value";
|
networkIdPath = "${config.clan.core.settings.directory}/vars/per-machine/${controllerMachine}/zerotier/zerotier-network-id/value";
|
||||||
networkId =
|
networkId = if builtins.pathExists networkIdPath then builtins.readFile networkIdPath else null;
|
||||||
if builtins.pathExists networkIdPath then
|
|
||||||
builtins.readFile networkIdPath
|
|
||||||
else
|
|
||||||
builtins.throw ''
|
|
||||||
No zerotier network id found for ${controllerMachine}.
|
|
||||||
Please run `clan vars generate ${controllerMachine}` first.
|
|
||||||
'';
|
|
||||||
moons = lib.attrNames (roles.moon.machines or { });
|
moons = lib.attrNames (roles.moon.machines or { });
|
||||||
moonIps = builtins.foldl' (
|
moonIps = builtins.foldl' (
|
||||||
ips: name:
|
ips: name:
|
||||||
|
|||||||
Reference in New Issue
Block a user