Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sarcasticadmin committed Feb 29, 2024
1 parent dfaf0b1 commit 9d984e6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions facts/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ def generatekeaconfig(servers, aps, vlans, outputdir):
"id": int(vlan["ipv6prefix"].replace(':', '')[-8:], 16),
"user-context": { "vlan": vlan["name"] },
"pools": [{"pool": vlan["ipv6dhcpStart"] + " - " + vlan["ipv6dhcpEnd"]}],
"interface": "eth0",
}
for vlan in vlans
if vlan["ipv6bitmask"]
Expand Down
13 changes: 12 additions & 1 deletion nix/tests/core.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ inputs, ... }:
{ inputs, pkgs, ... }:
let
prefix = "2001:470:f026:103";
routerAddr = {
Expand All @@ -9,6 +9,15 @@ let
ipv6 = "${prefix}::802";
ipv4 = "10.0.3.5";
};

dhcp6Sub = inputs.self.packages.${pkgs.system}.scaleInventory.overrideAttrs (oa: {
name = oa.name + "-test";
postInstall = ''
substituteInPlace $out/config/dhcp6-server.conf \
--replace "eth0" "eth1"
'';
});

in
{
name = "core";
Expand Down Expand Up @@ -58,6 +67,8 @@ in
virtualisation.vlans = [ 1 ];
virtualisation.graphics = false;
systemd.services.systemd-networkd.environment.SYSTEMD_LOG_LEVEL = "debug";
services.kea.dhcp6.configFile = lib.mkForce "${dhcp6Sub}/config/dhcp6-server.conf";
environment.etc = { "rob/hello".source = "${dhcp6Sub}/config/dhcp6-server.conf"; };
systemd.network = {
networks = {
"01-eth1" = {
Expand Down
4 changes: 2 additions & 2 deletions nix/tests/flake-module.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{ withSystem, inputs, ... }:
{ withSystem, inputs, pkgs, ... }:

{
flake.checks.x86_64-linux = withSystem "x86_64-linux" ({ pkgs, ... }: {
core = pkgs.testers.runNixOSTest (import ./core.nix { inherit inputs; });
core = pkgs.testers.runNixOSTest (import ./core.nix { inherit inputs pkgs; });
loghost = pkgs.testers.runNixOSTest ./loghost.nix;
});

Expand Down

0 comments on commit 9d984e6

Please sign in to comment.