Compare commits
2 commits
dea2425e27
...
06043e438e
Author | SHA1 | Date | |
---|---|---|---|
06043e438e | |||
fc8df77023 |
4 changed files with 43 additions and 47 deletions
|
@ -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"]
|
||||||
|
|
|
@ -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 = {
|
||||||
|
|
|
@ -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;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue