Merge pull request #7984 from rushmorem/marathon-module-update
Make it easy to override the marathon framework user
This commit is contained in:
commit
3b6dbb1917
|
@ -19,14 +19,6 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
httpPort = mkOption {
|
|
||||||
type = types.int;
|
|
||||||
default = 8080;
|
|
||||||
description = ''
|
|
||||||
Marathon listening port for HTTP connections.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
master = mkOption {
|
master = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "zk://${concatStringsSep "," cfg.zookeeperHosts}/mesos";
|
default = "zk://${concatStringsSep "," cfg.zookeeperHosts}/mesos";
|
||||||
|
@ -45,6 +37,25 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
user = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "marathon";
|
||||||
|
example = "root";
|
||||||
|
description = ''
|
||||||
|
The user that the Marathon framework will be launched as. If the user doesn't exist it will be created.
|
||||||
|
If you want to run apps that require root access or you want to launch apps using arbitrary users, that
|
||||||
|
is using the `--mesos_user` flag then you need to change this to `root`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
httpPort = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 8080;
|
||||||
|
description = ''
|
||||||
|
Marathon listening port for HTTP connections.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
extraCmdLineOptions = mkOption {
|
extraCmdLineOptions = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
|
@ -76,14 +87,12 @@ in {
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.marathon}/bin/marathon --master ${cfg.master} --zk zk://${concatStringsSep "," cfg.zookeeperHosts}/marathon --http_port ${toString cfg.httpPort} ${concatStringsSep " " cfg.extraCmdLineOptions}";
|
ExecStart = "${pkgs.marathon}/bin/marathon --master ${cfg.master} --zk zk://${concatStringsSep "," cfg.zookeeperHosts}/marathon --http_port ${toString cfg.httpPort} ${concatStringsSep " " cfg.extraCmdLineOptions}";
|
||||||
User = "marathon";
|
User = cfg.user;
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
RestartSec = "2";
|
RestartSec = "2";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
users.extraUsers.marathon = {
|
users.extraUsers.${cfg.user} = { };
|
||||||
description = "Marathon mesos framework user";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user