Skip to content
Snippets Groups Projects
Commit e2e770c5 authored by Florian Sesser's avatar Florian Sesser
Browse files

Add hosts mapping

... so Grafana shows us names instead of VPN IP addresses.

Avoiding catastrophy: It's all about minimizing cognitive overhead.
parent 1aaa3b8a
Branches
No related tags found
No related merge requests found
......@@ -8,6 +8,12 @@ import ../../lib/make-grid.nix {
let
sshUsers = import ../../../../PrivateStorageSecrets/localdev-users.nix;
vpnClientIPs = [ "172.23.23.11" "172.23.23.12" "172.23.23.13" ]; # TBD: derive automatically
hostsMap = {
"172.23.23.1" = [ "monitoring1" "monitoring1.monitoringvpn" ];
"172.23.23.11" = [ "payments1" "payments1.monitoringvpn" ];
"172.23.23.12" = [ "storage1" "storage1.monitoringvpn" ];
"172.23.23.13" = [ "storage2" "storage2.monitoringvpn" ];
};
in {
"payments1" = import ../../lib/make-issuer.nix (rec {
publicIPv4 = "192.168.67.21";
......@@ -37,8 +43,9 @@ import ../../lib/make-grid.nix {
publicIPv4 = "192.168.67.24";
monitoringvpnIPv4 = "172.23.23.1";
inherit vpnClientIPs;
inherit hostsMap;
inherit sshUsers;
nodeExporterTargets = [ "172.23.23.1" "172.23.23.11" "172.23.23.12" "172.23.23.13" ]; # TBD: derive automatically
nodeExporterTargets = [ "monitoring1" "payments1" "storage1" "storage2" ]; # TBD: derive automatically
nginxExporterTargets = [ ];
hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
stateVersion = "19.09";
......
......@@ -11,6 +11,7 @@
, vpnClientIPs
, nodeExporterTargets
, nginxExporterTargets
, hostsMap ? {}
, ... }:
# This doesn't work yet:
......@@ -75,4 +76,6 @@ rec {
};
system.stateVersion = stateVersion;
networking.hosts = hostsMap;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment