detection type vm
This commit is contained in:
parent
a647109cc2
commit
89c2029cbc
@ -76,7 +76,11 @@ export const generateVmDefinitions = (req: TerraformApplyRequest): string => {
|
||||
|
||||
const gateway = "192.168.143.254";
|
||||
const bridge = vm.bridge || "GUACALAN";
|
||||
const isWindows = vm.model && vm.model.toLowerCase() === 'windows';
|
||||
|
||||
// Check if model is explicitly windows OR if template name suggests windows
|
||||
const isWindows = (vm.model && vm.model.toLowerCase() === 'windows') ||
|
||||
(vm.template && /w(?:in|10|11|2019|2022)/i.test(vm.template));
|
||||
|
||||
const modelValue = isWindows ? cfg.modelWindows : cfg.modelLinux;
|
||||
|
||||
buf += ` network_interfaces = [\n`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user