modules/microvm: c3d2.deployment.server = "nomad"
This commit is contained in:
parent
497ef03b3c
commit
1b618f0cd8
|
@ -9,6 +9,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
c3d2.deployment = {
|
c3d2.deployment = {
|
||||||
|
server = "nomad";
|
||||||
mounts = [ "etc" "home" "var"];
|
mounts = [ "etc" "home" "var"];
|
||||||
mountBase = "/glusterfs/fast/microvms/${config.networking.hostName}";
|
mountBase = "/glusterfs/fast/microvms/${config.networking.hostName}";
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
c3d2.deployment = {
|
c3d2.deployment = {
|
||||||
server = "server10";
|
server = "nomad";
|
||||||
mounts = [];
|
mounts = [];
|
||||||
mountBase = "/glusterfs/fast/microvms/${config.networking.hostName}";
|
mountBase = "/glusterfs/fast/microvms/${config.networking.hostName}";
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,9 +29,12 @@ in
|
||||||
{
|
{
|
||||||
options.c3d2.deployment = with lib; {
|
options.c3d2.deployment = with lib; {
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = with types; nullOr (enum [ "server9" "server10" ]);
|
type = types.enum [ "server9" "server10" "nomad" ];
|
||||||
default = null;
|
default = null;
|
||||||
description = "Server that is supposed to host this MicroVM.";
|
description = ''
|
||||||
|
Server that is supposed to host this MicroVM,
|
||||||
|
or \"nomad\" for HA clustering.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
autoNetSetup = mkOption {
|
autoNetSetup = mkOption {
|
||||||
|
@ -58,6 +61,17 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.assertions = [ {
|
||||||
|
assertion =
|
||||||
|
config.c3d2.deployment.server == "nomad" ->
|
||||||
|
config.c3d2.deployment.mounts == [] ||
|
||||||
|
lib.hasPrefix "/glusterfs" config.c3d2.deployment.mountBase;
|
||||||
|
message = ''
|
||||||
|
Host \"${config.networking.hostName}\" is to be run on nomad
|
||||||
|
but its mountBase is not located on /glusterfs/...!
|
||||||
|
'';
|
||||||
|
} ];
|
||||||
|
|
||||||
config.system.build = with pkgs; {
|
config.system.build = with pkgs; {
|
||||||
copyToServer = writeScript "copy-to-${server}" ''
|
copyToServer = writeScript "copy-to-${server}" ''
|
||||||
#! ${runtimeShell} -e
|
#! ${runtimeShell} -e
|
||||||
|
|
Loading…
Reference in New Issue