too lazy to think of a message, so enjoy this pointless text. Good luck future me...
This commit is contained in:
parent
087b349926
commit
d68a3c2727
1 changed files with 10 additions and 6 deletions
|
|
@ -90,14 +90,14 @@ in
|
|||
let
|
||||
inherit (builtins) head pathExists readFile;
|
||||
|
||||
controller = head (lib.attrNames roles.controller.machines or {});
|
||||
server = head (lib.attrNames (roles.server.machines or { not_found = {}; }));
|
||||
|
||||
# Read the controller's ip address
|
||||
ipAddressPath = "${config.clan.core.settings.directory}/vars/per-machine/${controller}/k3s/ip_v4/value";
|
||||
# Read the server's ip address
|
||||
ipAddressPath = "${config.clan.core.settings.directory}/vars/per-machine/${server}/k3s/ip_v4/value";
|
||||
ipAddress = if pathExists ipAddressPath then readFile ipAddressPath else null;
|
||||
|
||||
# Read the controller's token
|
||||
# tokenPath = "${config.clan.core.settings.directory}/vars/per-machine/${controller}/k3s/token";
|
||||
# Read the server's token
|
||||
# tokenPath = "${config.clan.core.settings.directory}/vars/per-machine/${server}/k3s/token";
|
||||
# token = if pathExists tokenPath then readFile tokenPath else null;
|
||||
in
|
||||
{
|
||||
|
|
@ -118,10 +118,14 @@ in
|
|||
enable = true;
|
||||
role = "agent";
|
||||
tokenFile = config.clan.core.vars.generators.k3s.files.token.path;
|
||||
serverAddr = "https://${ipAddress}:6443";
|
||||
serverAddr = "https://${server}:6443";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
perMachine = { config, ... }: {
|
||||
exports.address = "https://${config.networking.fqdn}:6443";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue