This repository has no description
1.5 kB
40 lines
1{ config, lib, pkgs, ... }:
2{
3 services.consul = {
4 enable = true;
5 # dropPrivileges = false;
6 webUi = true;
7 # interface.bind = "retiolum";
8 extraConfig = {
9 bind_addr = config.krebs.build.host.nets.retiolum.ip4.addr;
10 bootstrap_expect = 3;
11 server = true;
12 # retry_join = config.services.consul.extraConfig.start_join;
13 retry_join = lib.mapAttrsToList (n: h:
14 lib.head h.nets.retiolum.aliases
15 ) (lib.filterAttrs (n: h: h.consul) config.krebs.hosts);
16 rejoin_after_leave = true;
17
18 # try to fix random lock loss on leader reelection
19 retry_interval = "3s";
20 };
21 };
22
23 environment.etc."consul.d/testservice.json".text = builtins.toJSON {
24 service = {
25 name = "testing";
26 };
27 };
28
29 krebs.iptables.tables.filter.INPUT.rules = [
30 { predicate = "-i retiolum -p tcp --dport 8300"; target = "ACCEPT"; }
31 { predicate = "-i retiolum -p tcp --dport 8301"; target = "ACCEPT"; }
32 { predicate = "-i retiolum -p udp --dport 8301"; target = "ACCEPT"; }
33 { predicate = "-i retiolum -p tcp --dport 8302"; target = "ACCEPT"; }
34 { predicate = "-i retiolum -p udp --dport 8302"; target = "ACCEPT"; }
35 { predicate = "-i retiolum -p tcp --dport 8400"; target = "ACCEPT"; }
36 { predicate = "-i retiolum -p tcp --dport 8500"; target = "ACCEPT"; }
37 { predicate = "-i retiolum -p tcp --dport 8600"; target = "ACCEPT"; }
38 { predicate = "-i retiolum -p udp --dport 8500"; target = "ACCEPT"; }
39 ];
40}