From 313712ebc2fc70adefd577f09f0d1795450b0b00 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 11 Dec 2018 21:41:11 +0100 Subject: hosts.*.net.retiolum.ip6.addr: use genipv6 --- krebs/3modules/external/default.nix | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'krebs/3modules/external') diff --git a/krebs/3modules/external/default.nix b/krebs/3modules/external/default.nix index 0aef2531..02d28ddc 100644 --- a/krebs/3modules/external/default.nix +++ b/krebs/3modules/external/default.nix @@ -1,19 +1,22 @@ -{ config, ... }: - with import ; +{ config, ... }: let -{ - hosts = mapAttrs (_: recursiveUpdate { + hostDefaults = hostName: host: flip recursiveUpdate host ({ ci = false; external = true; monitoring = false; - }) { + } // optionalAttrs (host.nets?retiolum) { + nets.retiolum.ip6.addr = + (krebs.genipv6 "retiolum" "external" { inherit hostName; }).address; + }); + +in { + hosts = mapAttrs hostDefaults { sokrateslaptop = { owner = config.krebs.users.sokratess; nets = { retiolum = { ip4.addr = "10.243.142.104"; - ip6.addr = "42:f8a1:044d:0f75:9d73:56d8:f432:c6cc"; aliases = [ "sokrateslaptop.r" ]; @@ -35,7 +38,6 @@ with import ; nets = { retiolum = { ip4.addr = "10.243.29.201"; - ip6.addr = "42:4234:6a6d:600::1"; aliases = [ "kruck.r" ]; @@ -62,7 +64,6 @@ with import ; nets = { retiolum = { ip4.addr = "10.243.2.2"; - ip6.addr = "42:2:5ca:da:3111::1"; aliases = [ "scardanelli.r" ]; @@ -90,7 +91,6 @@ with import ; nets = { retiolum = { ip4.addr = "10.243.2.1"; - ip6.addr = "42:2::0:3:05::1"; aliases = [ "homeros.r" ]; @@ -118,7 +118,6 @@ with import ; nets = { retiolum = { ip4.addr = "10.243.29.168"; - ip6.addr = "42:4992:6a6d:600::1"; aliases = [ "turingmachine.r" ]; @@ -148,14 +147,13 @@ with import ; ip4.addr = "129.215.197.11"; aliases = [ "eddie.i" ]; }; - retiolum = rec { + retiolum = { via = internet; addrs = [ - ip4.addr - ip6.addr + config.krebs.hosts.eddie.nets.retiolum.ip4.addr + config.krebs.hosts.eddie.nets.retiolum.ip6.addr ]; ip4.addr = "10.243.29.170"; - ip6.addr = "42:4992:6a6d:700::1"; aliases = [ "eddie.r" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- @@ -184,7 +182,6 @@ with import ; nets = { retiolum = { ip4.addr = "10.243.29.171"; - ip6.addr = "42:4992:6a6d:700::2"; aliases = [ "rock.r" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- @@ -214,7 +211,6 @@ with import ; retiolum = { via = internet; ip4.addr = "10.243.29.172"; - ip6.addr = "42:4992:6a6d:800::1"; aliases = [ "inspector.r" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- @@ -239,7 +235,6 @@ with import ; nets = rec { retiolum = { ip4.addr = "10.243.29.173"; - ip6.addr = "42:4992:6a6d:900::1"; aliases = [ "dpdkm.r" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- @@ -268,14 +263,13 @@ with import ; ip6.addr = "2a03:4000:13:31e::1"; aliases = [ "eve.i" ]; }; - retiolum = rec { + retiolum = { via = internet; addrs = [ - ip4.addr - ip6.addr + config.krebs.hosts.eve.nets.retiolum.ip4.addr + config.krebs.hosts.eve.nets.retiolum.ip6.addr ]; ip4.addr = "10.243.29.174"; - ip6.addr = "42:4992:6a6d:a00::1"; aliases = [ "eve.r" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- -- cgit v1.2.3