Newer
Older
# Load the helper function and call it with arguments tailored for the local
# grid. It will make the morph configuration for us. We share this function
# with the production grid and have one fewer possible point of divergence.
import ../../lib/make-grid.nix {
name = "LocalDev";
config = ./config.json;
nodes = cfg:
let
sshUsers = import ./secrets/users.nix;
# Get absolute vpn key directory path, as a string:
monitoringvpnKeyDir = toString ./. + "/${cfg.monitoringvpnKeyDir}";
# TBD: derive these automatically:
"172.23.23.1" = [ "monitoring" "monitoring.monitoringvpn" ];
"172.23.23.11" = [ "payments" "payments.monitoringvpn" ];
"172.23.23.12" = [ "storage1" "storage1.monitoringvpn" ];
"172.23.23.13" = [ "storage2" "storage2.monitoringvpn" ];
};
vpnClientIPs = [ "172.23.23.11" "172.23.23.12" "172.23.23.13" ];
nodeExporterTargets = [ "monitoring" "payments" "storage1" "storage2" ];
"payments" = import ../../lib/make-issuer.nix (cfg // rec {
publicIPv4 = "192.168.67.21";
hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
stateVersion = "19.03";
inherit monitoringvpnKeyDir;
inherit sshUsers;
"storage1" = import ../../lib/make-testing.nix (cfg // rec {
publicIPv4 = "192.168.67.22";
monitoringvpnIPv4 = "172.23.23.12";
hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
stateVersion = "19.09";
inherit monitoringvpnKeyDir;
inherit sshUsers;
"storage2" = import ../../lib/make-testing.nix (cfg // rec {
publicIPv4 = "192.168.67.23";
monitoringvpnIPv4 = "172.23.23.13";
hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
stateVersion = "19.09";
inherit monitoringvpnKeyDir;
inherit sshUsers;
"monitoring" = import ../../lib/make-monitoring.nix (cfg // rec {
inherit nodeExporterTargets;
hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
stateVersion = "19.09";
inherit monitoringvpnKeyDir;
inherit sshUsers;