3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #7857 from rushmorem/marathon-module-update

Update Marathon module
This commit is contained in:
Arseniy Seroka 2015-05-21 16:52:14 +03:00
commit f134150180
3 changed files with 42 additions and 12 deletions

View file

@ -17,6 +17,7 @@
<itemizedlist> <itemizedlist>
<listitem><para><literal>brltty</literal></para></listitem> <listitem><para><literal>brltty</literal></para></listitem>
<listitem><para><literal>marathon</literal></para></listitem>
</itemizedlist> </itemizedlist>
</para> </para>

View file

@ -196,7 +196,6 @@
nylon = 168; nylon = 168;
apache-kafka = 169; apache-kafka = 169;
panamax = 170; panamax = 170;
marathon = 171;
exim = 172; exim = 172;
#fleet = 173; # unused #fleet = 173; # unused
#input = 174; # unused #input = 174; # unused
@ -391,7 +390,6 @@
gitlab = 165; gitlab = 165;
nylon = 168; nylon = 168;
panamax = 170; panamax = 170;
#marathon = 171; # unused
exim = 172; exim = 172;
fleet = 173; fleet = 173;
input = 174; input = 174;

View file

@ -12,27 +12,56 @@ in {
options.services.marathon = { options.services.marathon = {
enable = mkOption { enable = mkOption {
description = "Whether to enable the marathon mesos framework.";
default = false;
type = types.uniq types.bool; type = types.uniq types.bool;
default = false;
description = ''
Whether to enable the marathon mesos framework.
'';
}; };
httpPort = mkOption { httpPort = mkOption {
description = "Marathon listening port";
default = 8080;
type = types.int; type = types.int;
default = 8080;
description = ''
Marathon listening port for HTTP connections.
'';
}; };
master = mkOption { master = mkOption {
description = "Marathon mesos master zookeeper address";
default = "zk://${head cfg.zookeeperHosts}/mesos";
type = types.str; type = types.str;
default = "zk://${concatStringsSep "," cfg.zookeeperHosts}/mesos";
example = "zk://1.2.3.4:2181,2.3.4.5:2181,3.4.5.6:2181/mesos";
description = ''
Mesos master address. See <link xlink:href="https://mesosphere.github.io/marathon/docs/"/> for details.
'';
}; };
zookeeperHosts = mkOption { zookeeperHosts = mkOption {
description = "Marathon mesos zookepper addresses";
default = [ "localhost:2181" ];
type = types.listOf types.str; type = types.listOf types.str;
default = [ "localhost:2181" ];
example = [ "1.2.3.4:2181" "2.3.4.5:2181" "3.4.5.6:2181" ];
description = ''
ZooKeeper hosts' addresses.
'';
};
extraCmdLineOptions = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "--https_port=8443" "--zk_timeout=10000" "--marathon_store_timeout=2000" ];
description = ''
Extra command line options to pass to Marathon.
See <link xlink:href="https://mesosphere.github.io/marathon/docs/command-line-flags.html"/> for all possible flags.
'';
};
environment = mkOption {
default = { };
type = types.attrs;
example = { JAVA_OPTS = "-Xmx512m"; MESOSPHERE_HTTP_CREDENTIALS = "username:password"; };
description = ''
Environment variables passed to Marathon.
'';
}; };
}; };
@ -41,17 +70,19 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.services.marathon = { systemd.services.marathon = {
description = "Marathon Service"; description = "Marathon Service";
environment = cfg.environment;
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network-interfaces.target" "zookeeper.service" "mesos-master.service" "mesos-slave.service" ]; after = [ "network-interfaces.target" "zookeeper.service" "mesos-master.service" "mesos-slave.service" ];
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.marathon}/bin/marathon --master ${cfg.master} --zk zk://${head cfg.zookeeperHosts}/marathon"; 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 = "marathon";
Restart = "always";
RestartSec = "2";
}; };
}; };
users.extraUsers.marathon = { users.extraUsers.marathon = {
uid = config.ids.uids.marathon;
description = "Marathon mesos framework user"; description = "Marathon mesos framework user";
}; };
}; };