Dustin Frisch
1 year ago
No known key found for this signature in database
GPG Key ID: B4C3BF012D9B26BE
6 changed files with 159 additions and 33 deletions
-
1machines/manager/default.nix
-
106machines/manager/dhcp.nix
-
41machines/manager/netinstall/default.nix
-
10machines/node/default.nix
-
4machines/node/network.nix
-
30machines/nodes.nix
@ -0,0 +1,106 @@ |
|||||
|
{ pkgs, lib, config, nodes, ... }: |
||||
|
|
||||
|
with lib; |
||||
|
|
||||
|
{ |
||||
|
services.kea = { |
||||
|
dhcp4 = { |
||||
|
enable = true; |
||||
|
settings = { |
||||
|
"valid-lifetime" = 4000; |
||||
|
"renew-timer" = 1000; |
||||
|
"rebind-timer" = 2000; |
||||
|
|
||||
|
"interfaces-config" = { |
||||
|
"interfaces" = [ "mngt" "data" ]; |
||||
|
}; |
||||
|
|
||||
|
"lease-database" = { |
||||
|
"type" = "memfile"; |
||||
|
"persist" = true; |
||||
|
"name" = "/var/lib/kea/dhcp4.leases"; |
||||
|
}; |
||||
|
|
||||
|
"subnet4" = [ |
||||
|
{ |
||||
|
"subnet" = "10.32.46.0/24"; |
||||
|
"interface" = "mngt"; |
||||
|
|
||||
|
"option-data" = [ |
||||
|
{ |
||||
|
"name" = "routers"; |
||||
|
"data" = "10.32.46.1"; |
||||
|
} |
||||
|
{ |
||||
|
"name" = "domain-name-servers"; |
||||
|
"data" = "10.0.0.53,10.1.1.10"; |
||||
|
} |
||||
|
{ |
||||
|
"name" = "domain-name"; |
||||
|
"data" = "mngt.${config.networking.domain}"; |
||||
|
} |
||||
|
{ |
||||
|
"name" = "domain-search"; |
||||
|
"data" = "mngt.${config.networking.domain}"; |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
"pools" = [ |
||||
|
{ |
||||
|
"pool" = "10.32.46.100-10.32.46.200"; |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
"reservations" = concatLists (mapAttrsToList |
||||
|
(_: node: optional |
||||
|
(node.config.networking.interfaces."mngt".macAddress != null) |
||||
|
{ |
||||
|
"hw-address" = node.config.networking.interfaces."mngt".macAddress; |
||||
|
"ip-address" = "10.32.46.${toString (100 + node.options._module.args.value.nodeId)}"; |
||||
|
}) |
||||
|
nodes); |
||||
|
} |
||||
|
|
||||
|
{ |
||||
|
"subnet" = "10.32.47.0/24"; |
||||
|
"interface" = "data"; |
||||
|
|
||||
|
"option-data" = [ |
||||
|
{ |
||||
|
"name" = "routers"; |
||||
|
"data" = "10.32.47.1"; |
||||
|
} |
||||
|
{ |
||||
|
"name" = "domain-name-servers"; |
||||
|
"data" = "10.0.0.53,10.1.1.10"; |
||||
|
} |
||||
|
{ |
||||
|
"name" = "domain-name"; |
||||
|
"data" = config.networking.domain; |
||||
|
} |
||||
|
{ |
||||
|
"name" = "domain-search"; |
||||
|
"data" = config.networking.domain; |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
"pools" = [ |
||||
|
{ |
||||
|
"pool" = "10.32.47.100-10.32.47.200"; |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
"reservations" = concatLists (mapAttrsToList |
||||
|
(_: node: optional |
||||
|
(node.config.networking.interfaces."data".macAddress != null) |
||||
|
{ |
||||
|
"hw-address" = node.config.networking.interfaces."data".macAddress; |
||||
|
"ip-address" = "10.32.47.${toString (100 + node.options._module.args.value.nodeId)}"; |
||||
|
}) |
||||
|
nodes); |
||||
|
} |
||||
|
]; |
||||
|
}; |
||||
|
}; |
||||
|
}; |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
{ |
||||
|
"node-00" = { |
||||
|
networking.interfaces."mngt".macAddress = "50:46:5D:DA:0C:C9"; |
||||
|
networking.interfaces."data".macAddress = "50:46:5d:da:0b:d6"; |
||||
|
}; |
||||
|
"node-01" = { |
||||
|
networking.interfaces."mngt".macAddress = "50:46:5D:DA:0C:07"; |
||||
|
networking.interfaces."data".macAddress = "50:46:5d:da:0c:56"; |
||||
|
}; |
||||
|
"node-02" = { |
||||
|
networking.interfaces."mngt".macAddress = "10:BF:48:19:B0:04"; |
||||
|
networking.interfaces."data".macAddress = "10:bf:48:1f:a6:8f"; |
||||
|
}; |
||||
|
"node-03" = { |
||||
|
networking.interfaces."mngt".macAddress = "10:BF:48:19:A4:FE"; |
||||
|
networking.interfaces."data".macAddress = "10:bf:48:1b:57:47"; |
||||
|
}; |
||||
|
"node-04" = { |
||||
|
networking.interfaces."mngt".macAddress = "10:BF:48:19:A2:E2"; |
||||
|
networking.interfaces."data".macAddress = "10:bf:48:19:a2:4d"; |
||||
|
}; |
||||
|
"node-05" = { |
||||
|
networking.interfaces."mngt".macAddress = "10:BF:48:15:00:F5"; |
||||
|
networking.interfaces."data".macAddress = "10:bf:48:1b:56:df"; |
||||
|
}; |
||||
|
"node-06" = { |
||||
|
networking.interfaces."mngt".macAddress = "50:46:5D:DA:0C:09"; |
||||
|
networking.interfaces."data".macAddress = "50:46:5d:da:0c:52"; |
||||
|
}; |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue