diff options
author | Arseniy Seroka <jagajaga@users.noreply.github.com> | 2015-05-21 16:52:14 +0300 |
---|---|---|
committer | Arseniy Seroka <jagajaga@users.noreply.github.com> | 2015-05-21 16:52:14 +0300 |
commit | f134150180499f6bd1bcd3f8ff80dab2778e1cf4 (patch) | |
tree | 77b75eeb74fc9700e5866dd085d0b73566b31ec6 /nixos | |
parent | 16a745fbb99c3bd003d7c5d410e2c05c565abebd (diff) | |
parent | b5820a5ebd034126d5d7d8c8cc60aa2d7a7c1b87 (diff) | |
download | nixpkgs-f134150180499f6bd1bcd3f8ff80dab2778e1cf4.tar nixpkgs-f134150180499f6bd1bcd3f8ff80dab2778e1cf4.tar.gz nixpkgs-f134150180499f6bd1bcd3f8ff80dab2778e1cf4.tar.bz2 nixpkgs-f134150180499f6bd1bcd3f8ff80dab2778e1cf4.tar.lz nixpkgs-f134150180499f6bd1bcd3f8ff80dab2778e1cf4.tar.xz nixpkgs-f134150180499f6bd1bcd3f8ff80dab2778e1cf4.tar.zst nixpkgs-f134150180499f6bd1bcd3f8ff80dab2778e1cf4.zip |
Merge pull request #7857 from rushmorem/marathon-module-update
Update Marathon module
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/doc/manual/release-notes/rl-unstable.xml | 1 | ||||
-rw-r--r-- | nixos/modules/misc/ids.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/scheduling/marathon.nix | 49 |
3 files changed, 41 insertions, 11 deletions
diff --git a/nixos/doc/manual/release-notes/rl-unstable.xml b/nixos/doc/manual/release-notes/rl-unstable.xml index 9563dcbb343..755b4bf4154 100644 --- a/nixos/doc/manual/release-notes/rl-unstable.xml +++ b/nixos/doc/manual/release-notes/rl-unstable.xml @@ -17,6 +17,7 @@ <itemizedlist> <listitem><para><literal>brltty</literal></para></listitem> +<listitem><para><literal>marathon</literal></para></listitem> </itemizedlist> </para> diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index 3f45f78a9d8..cc1976e236b 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -196,7 +196,6 @@ nylon = 168; apache-kafka = 169; panamax = 170; - marathon = 171; exim = 172; #fleet = 173; # unused #input = 174; # unused @@ -391,7 +390,6 @@ gitlab = 165; nylon = 168; panamax = 170; - #marathon = 171; # unused exim = 172; fleet = 173; input = 174; diff --git a/nixos/modules/services/scheduling/marathon.nix b/nixos/modules/services/scheduling/marathon.nix index 8513d1174c3..ab93334f5fc 100644 --- a/nixos/modules/services/scheduling/marathon.nix +++ b/nixos/modules/services/scheduling/marathon.nix @@ -12,27 +12,56 @@ in { options.services.marathon = { enable = mkOption { - description = "Whether to enable the marathon mesos framework."; - default = false; type = types.uniq types.bool; + default = false; + description = '' + Whether to enable the marathon mesos framework. + ''; }; httpPort = mkOption { - description = "Marathon listening port"; - default = 8080; type = types.int; + default = 8080; + description = '' + Marathon listening port for HTTP connections. + ''; }; master = mkOption { - description = "Marathon mesos master zookeeper address"; - default = "zk://${head cfg.zookeeperHosts}/mesos"; 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 { - description = "Marathon mesos zookepper addresses"; + 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 { systemd.services.marathon = { description = "Marathon Service"; + environment = cfg.environment; wantedBy = [ "multi-user.target" ]; after = [ "network-interfaces.target" "zookeeper.service" "mesos-master.service" "mesos-slave.service" ]; 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"; + Restart = "always"; + RestartSec = "2"; }; }; users.extraUsers.marathon = { - uid = config.ids.uids.marathon; description = "Marathon mesos framework user"; }; }; |