From 22dadde50a49397ddca8da1b9d1e4e2d57e8e0e3 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 14 Mar 2021 15:52:53 +0000 Subject: [PATCH] blade-torres: remap en-storage onto a vlan --- ops/nixos/blade-torres/default.nix | 10 +++++++++- ops/nixos/lib/blade.nix | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ops/nixos/blade-torres/default.nix b/ops/nixos/blade-torres/default.nix index 788f997d15..0f1d800c0d 100644 --- a/ops/nixos/blade-torres/default.nix +++ b/ops/nixos/blade-torres/default.nix @@ -16,12 +16,20 @@ in { networking = { hostName = "blade-torres"; hostId = "86db1d9c"; + + # HACK: torres' secondary intf. seems to be having problems + # temporarily remap this onto the VLANs with everything else. + vlans.en-storage = { + id = 101; + interface = "en-int"; + }; }; my.ip.tailscale = "100.92.118.36"; my.blade.bay = 8; my.blade.macAddress = { internal = "e4:11:5b:ac:e3:cc"; - storage = "e4:11:5b:ac:e3:d0"; + storage = null; + #storage = "e4:11:5b:ac:e3:d0"; }; services.ceph = { diff --git a/ops/nixos/lib/blade.nix b/ops/nixos/lib/blade.nix index 2ee6e74804..3fbb0b1a9f 100644 --- a/ops/nixos/lib/blade.nix +++ b/ops/nixos/lib/blade.nix @@ -18,7 +18,7 @@ in { type = lib.types.str; }; macAddress.storage = lib.mkOption { - type = lib.types.str; + type = lib.types.nullOr lib.types.str; }; macAddress.internet = lib.mkOption { type = lib.types.nullOr lib.types.str; @@ -97,6 +97,7 @@ in { }; services.udev.extraRules = '' ATTR{address}=="${config.my.blade.macAddress.internal}", NAME="en-int" + '' + (lib.optionalString (config.my.blade.macAddress.storage != null) '' ATTR{address}=="${config.my.blade.macAddress.storage}", NAME="en-storage" '' + (lib.optionalString (config.my.blade.macAddress.internet != null) '' ATTR{address}=="${config.my.blade.macAddress.internet}", NAME="en-internet"