forked from zentralwerk/network
config: add dhcpOpts, import from salt-pillar
This commit is contained in:
parent
9afc25d6c3
commit
74c10c0446
|
@ -25,6 +25,13 @@ in
|
|||
(builtins.mapAttrs (_: vlan: { vlan = vlan; }) pillar.vlans)
|
||||
(builtins.mapAttrs (_: subnet4: { inherit subnet4; }) pillar.subnets-inet)
|
||||
(builtins.mapAttrs (_: hosts4: { inherit hosts4; }) pillar.hosts-inet)
|
||||
(builtins.mapAttrs (_: dhcpData: {
|
||||
dhcp = {
|
||||
inherit (dhcpData) start end time max-time;
|
||||
router = dhcpData.host-opts.routers;
|
||||
domainName = dhcpData.string-opts.domain-name;
|
||||
};
|
||||
}) pillar.dhcp)
|
||||
{ core.ospf.secret = pillar.ospf.secret; }
|
||||
] ++ (
|
||||
map (ctx:
|
||||
|
|
|
@ -2,6 +2,32 @@
|
|||
|
||||
with lib;
|
||||
let
|
||||
dhcpOpts = {
|
||||
start = mkOption {
|
||||
description = "First IP address in pool";
|
||||
type = types.str;
|
||||
};
|
||||
end = mkOption {
|
||||
description = "Last IP address in pool";
|
||||
type = types.str;
|
||||
};
|
||||
time = mkOption {
|
||||
description = "Renew time in seconds";
|
||||
type = types.int;
|
||||
};
|
||||
max-time = mkOption {
|
||||
description = "Max renew time in seconds";
|
||||
type = types.int;
|
||||
};
|
||||
router = mkOption {
|
||||
description = "Gateway";
|
||||
type = types.str;
|
||||
};
|
||||
domainName = mkOption {
|
||||
description = "Domain name option";
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
netOpts = { name, ... }: {
|
||||
options = {
|
||||
vlan = mkOption {
|
||||
|
@ -45,6 +71,10 @@ let
|
|||
default = null;
|
||||
};
|
||||
};
|
||||
dhcp = mkOption {
|
||||
type = with types; nullOr (submodule { options = dhcpOpts; });
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
interfaceOpts = { name, ... }: {
|
||||
|
|
Loading…
Reference in New Issue