lib/config/options+legacy: add bgp
This commit is contained in:
parent
8013241d6c
commit
aed29a54ce
|
@ -121,14 +121,25 @@ in
|
||||||
|
|
||||||
ospf =
|
ospf =
|
||||||
let
|
let
|
||||||
hostPillar = self.lib.saltPillarFor name;
|
ospfConf = ctPillar.ospf;
|
||||||
ospfConf = hostPillar.ospf;
|
in lib.optionalAttrs (ctPillar ? ospf && ospfConf ? stubnets-inet) {
|
||||||
in lib.optionalAttrs (hostPillar ? ospf && ospfConf ? stubnets-inet) {
|
|
||||||
stubNets4 = ospfConf.stubnets-inet;
|
stubNets4 = ospfConf.stubnets-inet;
|
||||||
} // lib.optionalAttrs (hostPillar ? ospf && ospfConf ? stubnets-inet6) {
|
} // lib.optionalAttrs (ctPillar ? ospf && ospfConf ? stubnets-inet6) {
|
||||||
stubNets6 = ospfConf.stubnets-inet6;
|
stubNets6 = ospfConf.stubnets-inet6;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bgp =
|
||||||
|
if ctPillar ? bgp
|
||||||
|
then
|
||||||
|
let
|
||||||
|
bgpConf = ctPillar.bgp;
|
||||||
|
in {
|
||||||
|
inherit (bgpConf) asn;
|
||||||
|
peers4 = bgpConf.peers-inet;
|
||||||
|
peers6 = bgpConf.peers-inet6;
|
||||||
|
}
|
||||||
|
else null;
|
||||||
|
|
||||||
forwardPorts =
|
forwardPorts =
|
||||||
if ctPillar ? port-forwarding
|
if ctPillar ? port-forwarding
|
||||||
then map ({ proto, port, to }: {
|
then map ({ proto, port, to }: {
|
||||||
|
|
|
@ -221,6 +221,32 @@ let
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
};
|
};
|
||||||
|
bgp = mkOption {
|
||||||
|
default = null;
|
||||||
|
type = with types; nullOr (submodule {
|
||||||
|
options = bgpOpts;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
bgpPeerOpts = { name, ... }: {
|
||||||
|
options = {
|
||||||
|
asn = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
bgpOpts = {
|
||||||
|
asn = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
};
|
||||||
|
peers4 = mkOption {
|
||||||
|
type = with types; attrsOf (submodule bgpPeerOpts);
|
||||||
|
default = {};
|
||||||
|
};
|
||||||
|
peers6 = mkOption {
|
||||||
|
type = with types; attrsOf (submodule bgpPeerOpts);
|
||||||
|
default = {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in New Issue