Commit bbc9e6e0 authored by nanahira's avatar nanahira

move

parent e517a144
......@@ -118,13 +118,7 @@ class InventoryBuilder {
}
async main() {
this.vars = await this.loadUtilities();
this.hosts = _.keyBy(await this.load('nextgen2'), 'name');
this.gateways = _.mapValues(_.groupBy(await this.loadGateways(), 'router'), g => _.keyBy(g, 'isp'));
this.gatewayGroups = await this.load('gateway groups') as GatewayGroup[];
//console.log(this.gateways);
this.connections = _.intersection(Object.keys(this.hosts), Object.keys(_.find(this.hosts)));
const subnets = await this.load('subnets');
for (const [name, router] of Object.entries(this.hosts)) {
router.lanInterfaces = subnets
......@@ -133,6 +127,12 @@ class InventoryBuilder {
.filter((i) => i);
router.subnets = subnets.filter((subnet) => subnet.router === name).map((subnet) => subnet.subnet);
}
this.vars = await this.loadUtilities();
this.gateways = _.mapValues(_.groupBy(await this.loadGateways(), 'router'), g => _.keyBy(g, 'isp'));
this.gatewayGroups = await this.load('gateway groups') as GatewayGroup[];
//console.log(this.gateways);
this.connections = _.intersection(Object.keys(this.hosts), Object.keys(_.find(this.hosts)));
for (const host of Object.values(this.hosts)) {
host.wgPublickey = await this.wgPublickey(host.wgPrivateKey);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment