network/config/net/cluster.nix

167 lines
5.1 KiB
Nix

{ lib, ... }:
let
cephMonServers = [ "server5" "server6" "server8" ];
in
{
site.net.cluster = {
domainName = "cluster.zentralwerk.org";
extraRecords = map (host: {
data = "1 1 6789 ${host}";
name = "_ceph-mon._tcp";
type = "SRV";
}) cephMonServers
++
lib.lists.imap0 (i: host: {
name = "mon${toString i}";
type = "CNAME";
data = "${host}";
}) cephMonServers;
hosts4 = {
cls-gw = "172.20.77.1";
server1 = "172.20.77.30";
server2 = "172.20.77.2";
server3 = "172.20.77.3";
server4 = "172.20.77.4";
server5 = "172.20.77.5";
server6 = "172.20.77.6";
server7 = "172.20.77.7";
server8 = "172.20.77.8";
server9 = "172.20.77.9";
server10 = "172.20.77.10";
server11 = "172.20.77.11";
server12 = "172.20.77.12";
server13 = "172.20.77.13";
server14 = "172.20.77.14";
server15 = "172.20.77.15";
server16 = "172.20.77.16";
server17 = "172.20.77.17";
server18 = "172.20.77.18";
server19 = "172.20.77.19";
server20 = "172.20.77.20";
server21 = "172.20.77.21";
server22 = "172.20.77.22";
server23 = "172.20.77.23";
server24 = "172.20.77.24";
server25 = "172.20.77.25";
server26 = "172.20.77.26";
server27 = "172.20.77.27";
server28 = "172.20.77.28";
server29 = "172.20.77.29";
};
hosts6 = {
dn42 = {
cls-gw = "fd23:42:c3d2:586::1";
server1 = "fd23:42:c3d2:586::130";
server2 = "fd23:42:c3d2:586::12";
server3 = "fd23:42:c3d2:586::13";
server4 = "fd23:42:c3d2:586::14";
server5 = "fd23:42:c3d2:586::15";
server6 = "fd23:42:c3d2:586::16";
server7 = "fd23:42:c3d2:586::17";
server8 = "fd23:42:c3d2:586::18";
server9 = "fd23:42:c3d2:586::19";
server10 = "fd23:42:c3d2:586::110";
server11 = "fd23:42:c3d2:586::111";
server12 = "fd23:42:c3d2:586::112";
server13 = "fd23:42:c3d2:586::113";
server14 = "fd23:42:c3d2:586::114";
server15 = "fd23:42:c3d2:586::115";
server16 = "fd23:42:c3d2:586::116";
server17 = "fd23:42:c3d2:586::117";
server18 = "fd23:42:c3d2:586::118";
server19 = "fd23:42:c3d2:586::119";
server20 = "fd23:42:c3d2:586::120";
server21 = "fd23:42:c3d2:586::121";
server22 = "fd23:42:c3d2:586::122";
server23 = "fd23:42:c3d2:586::123";
server24 = "fd23:42:c3d2:586::124";
server25 = "fd23:42:c3d2:586::125";
server26 = "fd23:42:c3d2:586::126";
server27 = "fd23:42:c3d2:586::127";
server28 = "fd23:42:c3d2:586::128";
server29 = "fd23:42:c3d2:586::129";
};
up4 = {
cls-gw = "2a00:8180:2c00:284::1";
server1 = "2a00:8180:2c00:284::130";
server2 = "2a00:8180:2c00:284::12";
server3 = "2a00:8180:2c00:284::13";
server4 = "2a00:8180:2c00:284::14";
server5 = "2a00:8180:2c00:284::15";
server6 = "2a00:8180:2c00:284::16";
server7 = "2a00:8180:2c00:284::17";
server8 = "2a00:8180:2c00:284::18";
server9 = "2a00:8180:2c00:284::19";
server10 = "2a00:8180:2c00:284::110";
server11 = "2a00:8180:2c00:284::111";
server12 = "2a00:8180:2c00:284::112";
server13 = "2a00:8180:2c00:284::113";
server14 = "2a00:8180:2c00:284::114";
server15 = "2a00:8180:2c00:284::115";
server16 = "2a00:8180:2c00:284::116";
server17 = "2a00:8180:2c00:284::117";
server18 = "2a00:8180:2c00:284::118";
server19 = "2a00:8180:2c00:284::119";
server20 = "2a00:8180:2c00:284::120";
server21 = "2a00:8180:2c00:284::121";
server22 = "2a00:8180:2c00:284::122";
server23 = "2a00:8180:2c00:284::123";
server24 = "2a00:8180:2c00:284::124";
server25 = "2a00:8180:2c00:284::125";
server26 = "2a00:8180:2c00:284::126";
server27 = "2a00:8180:2c00:284::127";
server28 = "2a00:8180:2c00:284::128";
server29 = "2a00:8180:2c00:284::129";
};
};
subnet4 = "172.20.77.0/27";
subnets6 = {
dn42 = "fd23:42:c3d2:586::/64";
up4 = "2a00:8180:2c00:284::/64";
};
};
site.hosts =
let
makeServer = {
role = "client";
model = "proxmox";
interfaces = builtins.foldl' (interfaces: net:
interfaces // {
"${net}".type = "bridge";
}
) {} [
"cluster"
"core"
"mgmt"
"serv"
"c3d2"
"pub"
"priv23"
"bmx"
];
};
in {
cls-gw = {
role = "container";
interfaces = {
cluster = {
hwaddr = "0A:14:48:01:06:02";
type = "veth";
};
core = {
hwaddr = "0A:14:48:01:06:03";
type = "veth";
};
};
ospf.allowedUpstreams = [ "upstream4" "upstream1" "upstream3" "anon1" "freifunk" ];
};
server3 = makeServer;
server5 = makeServer;
server6 = makeServer;
server7 = makeServer;
server8 = makeServer;
server9 = makeServer;
};
}