Skip to content

Commit

Permalink
fix(os-reference): change logic to select which type of vm should be …
Browse files Browse the repository at this point in the history
…deployed

closes #39

Signed-off-by: Roberth Strand <[email protected]>
  • Loading branch information
roberthstrand committed Feb 24, 2022
1 parent 856fb3a commit 0ba24d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ locals {

vm_id = local.os_type != "windows" ? azurerm_linux_virtual_machine.machine[0].id : azurerm_windows_virtual_machine.machine[0].id
image_id_os = var.source_image_id.os == "windows" ? "windows" : "linux"
image_reference_os = can(regex("(windows)", lower(var.source_image_reference.publisher))) ? "windows" : "linux"
image_reference_os = can(regex("(microsoft)", lower(var.source_image_reference.publisher))) ? "windows" : "linux"
os_type = var.source_image_id.os == null ? local.image_reference_os : local.image_id_os
}

0 comments on commit 0ba24d7

Please sign in to comment.