inventory: allow per role configuration
This commit is contained in:
@@ -83,6 +83,11 @@ let
|
|||||||
else
|
else
|
||||||
throw "Module doesn't have role: '${role}'. Path: ${path} not found."
|
throw "Module doesn't have role: '${role}'. Path: ${path} not found."
|
||||||
) inverseRoles.${machineName} or [ ];
|
) inverseRoles.${machineName} or [ ];
|
||||||
|
|
||||||
|
roleServiceConfigs = builtins.map (
|
||||||
|
role:
|
||||||
|
serviceConfig.roles.${role}.config or { }
|
||||||
|
) inverseRoles.${machineName} or [ ];
|
||||||
in
|
in
|
||||||
if isInService then
|
if isInService then
|
||||||
acc2
|
acc2
|
||||||
@@ -92,6 +97,7 @@ let
|
|||||||
config.clan.${moduleName} = lib.mkMerge [
|
config.clan.${moduleName} = lib.mkMerge [
|
||||||
globalConfig
|
globalConfig
|
||||||
machineServiceConfig
|
machineServiceConfig
|
||||||
|
roleServiceConfigs
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ in
|
|||||||
apply = lib.unique;
|
apply = lib.unique;
|
||||||
type = t.listOf tagRef;
|
type = t.listOf tagRef;
|
||||||
};
|
};
|
||||||
|
options.config = moduleConfig;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user