git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #7302 from ragnard/mesos-slave-without-docker

mesos-slave: Docker optional & IP address configurable

commitab0ac154f9642cc013ed78eac200ce03d7be4985 authorWout Mertens <Wout.Mertens@gmail.com> dateThu 28 May 2015, 11:43 (12 years ago) parent7a9e0a5045e93e
1 file changed+20−5
nixos/modules/services/misc/mesos-slave.nix+20−5
nixos/modules/services/misc/mesos-slave.nix+20−5
@@ -12,6 +12,8 @@ let
1212 attribsArg = optionalString (cfg.attributes != {})
1313 "--attributes=${mkAttributes cfg.attributes}";
1414
15+ containerizers = [ "mesos" ] ++ (optional cfg.withDocker "docker");
16+
1517in {
1618
1719 options.services.mesos = {
@@ -22,8 +24,14 @@ in {
2224 type = types.uniq types.bool;
2325 };
2426
27+ ip = mkOption {
28+ description = "IP address to listen on.";
29+ default = "0.0.0.0";
30+ type = types.string;
31+ };
32+
2533 port = mkOption {
26− description = "Mesos Slave port";
34+ description = "Port to listen on.";
2735 default = 5051;
2836 type = types.int;
2937 };
@@ -43,6 +51,12 @@ in {
4351 type = types.bool;
4452 };
4553
54+ withDocker = mkOption {
55+ description = "Enable the docker containerizer.";
56+ default = config.virtualisation.docker.enable;
57+ type = types.bool;
58+ };
59+
4660 workDir = mkOption {
4761 description = "The Mesos work directory.";
4862 default = "/var/lib/mesos/slave";
@@ -92,17 +106,18 @@ in {
92106 description = "Mesos Slave";
93107 wantedBy = [ "multi-user.target" ];
94108 after = [ "network-interfaces.target" ];
95− environment.MESOS_CONTAINERIZERS = "docker,mesos";
109+ environment.MESOS_CONTAINERIZERS = concatStringsSep "," containerizers;
96110 serviceConfig = {
97111 ExecStart = ''
98112 ${pkgs.mesos}/bin/mesos-slave \
113+ --ip=${cfg.ip} \
99114 --port=${toString cfg.port} \
100115 --master=${cfg.master} \
101− ${optionalString cfg.withHadoop "--hadoop-home=${pkgs.hadoop}"} \
102− ${attribsArg} \
103116 --work_dir=${cfg.workDir} \
104117 --logging_level=${cfg.logLevel} \
105− --docker=${pkgs.docker}/libexec/docker/docker \
118+ ${attribsArg} \
119+ ${optionalString cfg.withHadoop "--hadoop-home=${pkgs.hadoop}"} \
120+ ${optionalString cfg.withDocker "--docker=${pkgs.docker}/libexec/docker/docker"} \
106121 ${toString cfg.extraCmdLineOptions}
107122 '';
108123 PermissionsStartOnly = true;