From 14ac6d3bba12f07bd8aa79221b9c64469fe03046 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 22 Jul 2015 19:25:51 +0200 Subject: * tv: regen ids --- 3modules/tv/consul.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '3modules/tv/consul.nix') diff --git a/3modules/tv/consul.nix b/3modules/tv/consul.nix index 480198456..db0cd7a9e 100644 --- a/3modules/tv/consul.nix +++ b/3modules/tv/consul.nix @@ -88,7 +88,7 @@ let ExecStartPre = pkgs.writeScript "consul-init" '' #! /bin/sh mkdir -p ${cfg.data-dir} - chown consul: ${cfg.data-dir} + chown ${user.name}: ${cfg.data-dir} install -o ${user.name} -m 0400 ${cfg.encrypt-file} /tmp/encrypt.json ''; ExecStart = pkgs.writeScript "consul-service" '' @@ -111,7 +111,7 @@ let user = { name = "consul"; - uid = 2983239726; # genid consul + uid = 2999951406; # genid consul }; in -- cgit v1.2.3 From 504b1b90e809934a01357450ccdf35c4e4afc74d Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 23 Jul 2015 00:37:21 +0200 Subject: * tv identity: define type harder --- 3modules/tv/consul.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to '3modules/tv/consul.nix') diff --git a/3modules/tv/consul.nix b/3modules/tv/consul.nix index db0cd7a9e..312faa02f 100644 --- a/3modules/tv/consul.nix +++ b/3modules/tv/consul.nix @@ -5,8 +5,7 @@ # TODO consul-bootstrap HOST that actually does is # TODO tools to inspect state of a cluster in outage state -with builtins; -with lib; +with import ../../4lib/tv { inherit lib pkgs; }; let cfg = config.tv.consul; @@ -24,10 +23,10 @@ let enable = mkEnableOption "tv.consul"; dc = mkOption { - type = types.unspecified; + type = types.label; }; hosts = mkOption { - type = with types; listOf unspecified; + type = with types; listOf host; }; encrypt-file = mkOption { type = types.str; # TODO path (but not just into store) @@ -38,7 +37,7 @@ let default = "/var/lib/consul"; }; self = mkOption { - type = types.unspecified; + type = types.host; }; server = mkOption { type = types.bool; @@ -56,9 +55,11 @@ let log_level = "INFO"; #node_name = server = cfg.server; - bind_addr = cfg.self.addr; # TODO cfg.addr enable_syslog = true; - retry_join = map (getAttr "addr") (filter (host: host.fqdn != cfg.self.fqdn) cfg.hosts); + retry_join = + # TODO allow consul in other nets than retiolum [maybe] + concatMap (host: host.nets.retiolum.addrs) + (filter (host: host.name != cfg.self.name) cfg.hosts); leave_on_terminate = true; } // optionalAttrs cfg.server { bootstrap_expect = length cfg.hosts; -- cgit v1.2.3