inventory: refactor role resolution into submodule

This commit is contained in:
Johannes Kirschbauer
2025-02-05 18:00:15 +07:00
parent 6deaab506a
commit f9fc6904f0
3 changed files with 120 additions and 91 deletions

View File

@@ -231,7 +231,7 @@ in
expr = configs.machines.machine_1.machineImports;
expectedError = {
type = "ThrownError";
msg = "Roles roleXYZ are not defined in the service borgbackup.";
msg = ''Roles \["roleXYZ"\] are not defined in the service borgbackup'';
};
};
# Needs NIX_ABORT_ON_WARN=1
@@ -286,7 +286,9 @@ in
in
{
inherit configs;
expr = builtins.filter (v: v != { }) configs.machines.machine_1.machineImports;
expr = builtins.filter (
v: v != { } && !v.clan.inventory.assertions ? "alive.assertion.inventory"
) configs.machines.machine_1.machineImports;
expected = [ ];
};
}