Commit fb27e0da authored by nanahira's avatar nanahira

remove switch hosts

parent bfe34fca
......@@ -102,16 +102,16 @@ class InventoryBuilder {
const rawHosts = await Promise.all(Object.values(this.hosts).map(async (h) => [h.name, await this.host_vars(h)]));
const hosts = Object.fromEntries(rawHosts);
// console.log(hosts);
const rawHostsForSwitch = rawHosts.map(rh => {
/* const rawHostsForSwitch = rawHosts.map(rh => {
const hostVars = JSON.parse(JSON.stringify(rh[1]));
hostVars.ansible_ssh_host = hostVars.address;
hostVars.ansible_ssh_port = this.hosts[rh[0]].sshSystem || 22;
return [`switch-${rh[0]}`, hostVars];
});
const switchHosts = Object.fromEntries(rawHostsForSwitch);
const switchHosts = Object.fromEntries(rawHostsForSwitch); */
const result = YAML.stringify({
wg: { hosts, vars: this.vars },
switch: { hosts: switchHosts, vars: JSON.parse(JSON.stringify(this.vars)) }
//switch: { hosts: switchHosts, vars: JSON.parse(JSON.stringify(this.vars)) }
});
return fs.promises.writeFile('result/inventory.yaml', result);
}
......
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