Compare commits

..

2 commits

Author SHA1 Message Date
Max
06043e438e fixup! cluster/services/consul: test in simulacrum 2024-08-13 22:07:28 +02:00
Max
fc8df77023 modules/system-info: drop 2024-08-13 22:05:23 +02:00
4 changed files with 43 additions and 47 deletions

View file

@ -5,9 +5,10 @@
start_all() start_all()
with subtest("should form cluster"): with subtest("should form cluster"):
for machine in machines: nodes = [ n for n in machines if n != nowhere ]
for machine in nodes:
machine.succeed("systemctl start consul-ready.service") machine.succeed("systemctl start consul-ready.service")
for machine in machines: for machine in nodes:
consulConfig = json.loads(machine.succeed("cat /etc/consul.json")) consulConfig = json.loads(machine.succeed("cat /etc/consul.json"))
addr = consulConfig["addresses"]["http"] addr = consulConfig["addresses"]["http"]
port = consulConfig["ports"]["http"] port = consulConfig["ports"]["http"]

View file

@ -59,13 +59,11 @@ testers.runNixOSTest {
imports = [ imports = [
serviceConfig.simulacrum.settings serviceConfig.simulacrum.settings
./nowhere ./nowhere
({ config, ... }: { {
config = lib.mkIf config.nowhere.enable {
nodes.nowhere.imports = [ nodes.nowhere.imports = [
lift.flake.nixosModules.port-magic config.flake.nixosModules.port-magic
]; ];
}; }
})
] ++ allAugments; ] ++ allAugments;
_module.args = { _module.args = {

View file

@ -58,7 +58,6 @@ in
imports = [ imports = [
./options.nix ./options.nix
]; ];
config = lib.mkIf config.nowhere.enable {
defaults = { defaults = {
networking.hosts."${getNodeAddr "nowhere"}" = lib.attrNames config.nowhere.names; networking.hosts."${getNodeAddr "nowhere"}" = lib.attrNames config.nowhere.names;
security.pki.certificateFiles = [ security.pki.certificateFiles = [
@ -99,5 +98,4 @@ in
}) lift.nowhere.names; }) lift.nowhere.names;
}; };
}; };
};
} }

View file

@ -2,7 +2,6 @@
{ {
options.nowhere = { options.nowhere = {
enable = lib.mkEnableOption "Nowhere";
names = lib.mkOption { names = lib.mkOption {
description = "Hostnames that point Nowhere."; description = "Hostnames that point Nowhere.";
type = with lib.types; attrsOf str; type = with lib.types; attrsOf str;