nixos/mesos: convert quorum to string

This commit is contained in:
Jaka Hudoklin 2014-12-01 16:57:17 +01:00
parent 5fa87a9df7
commit 827ad85a1e

View File

@ -4,11 +4,11 @@ with lib;
let let
cfg = config.services.mesos.master; cfg = config.services.mesos.master;
in { in {
options.services.mesos = { options.services.mesos = {
master = { master = {
enable = mkOption { enable = mkOption {
description = "Whether to enable the Mesos Master."; description = "Whether to enable the Mesos Master.";
@ -31,36 +31,36 @@ in {
''; '';
type = types.str; type = types.str;
}; };
workDir = mkOption { workDir = mkOption {
description = "The Mesos work directory."; description = "The Mesos work directory.";
default = "/var/lib/mesos/master"; default = "/var/lib/mesos/master";
type = types.str; type = types.str;
}; };
extraCmdLineOptions = mkOption { extraCmdLineOptions = mkOption {
description = '' description = ''
Extra command line options for Mesos Master. Extra command line options for Mesos Master.
See https://mesos.apache.org/documentation/latest/configuration/ See https://mesos.apache.org/documentation/latest/configuration/
''; '';
default = [ "" ]; default = [ "" ];
type = types.listOf types.string; type = types.listOf types.string;
example = [ "--credentials=VALUE" ]; example = [ "--credentials=VALUE" ];
}; };
quorum = mkOption { quorum = mkOption {
description = '' description = ''
The size of the quorum of replicas when using 'replicated_log' based The size of the quorum of replicas when using 'replicated_log' based
registry. It is imperative to set this value to be a majority of registry. It is imperative to set this value to be a majority of
masters i.e., quorum > (number of masters)/2. masters i.e., quorum > (number of masters)/2.
If 0 will fall back to --registry=in_memory. If 0 will fall back to --registry=in_memory.
''; '';
default = 0; default = 0;
type = types.int; type = types.int;
}; };
logLevel = mkOption { logLevel = mkOption {
description = '' description = ''
The logging level used. Possible values: The logging level used. Possible values:
@ -86,7 +86,7 @@ in {
${pkgs.mesos}/bin/mesos-master \ ${pkgs.mesos}/bin/mesos-master \
--port=${toString cfg.port} \ --port=${toString cfg.port} \
--zk=${cfg.zk} \ --zk=${cfg.zk} \
${if cfg.quorum == 0 then "--registry=in_memory" else "--registry=replicated_log --quorum=${cfg.quorum}"} \ ${if cfg.quorum == 0 then "--registry=in_memory" else "--registry=replicated_log --quorum=${toString cfg.quorum}"} \
--work_dir=${cfg.workDir} \ --work_dir=${cfg.workDir} \
--logging_level=${cfg.logLevel} \ --logging_level=${cfg.logLevel} \
${toString cfg.extraCmdLineOptions} ${toString cfg.extraCmdLineOptions}
@ -98,6 +98,6 @@ in {
''; '';
}; };
}; };
} }