diff --git a/main.tf b/main.tf index 8c225d0..c671a9e 100644 --- a/main.tf +++ b/main.tf @@ -36,7 +36,7 @@ resource "azurerm_storage_account" "vm-sa" { } resource "azurerm_virtual_machine" "vm-linux" { - count = "${!contains(list("${var.vm_os_simple}","${var.vm_os_offer}"), "WindowsServer") && var.is_windows_image != "true" && var.data_disk == "false" ? var.nb_instances : 0}" + count = "${!contains(list("${var.vm_os_simple}","${var.vm_os_offer}"), "Windows") && var.is_windows_image != "true" && var.data_disk == "false" ? var.nb_instances : 0}" name = "${var.vm_hostname}${count.index}" location = "${var.location}" resource_group_name = "${azurerm_resource_group.vm.name}" @@ -84,7 +84,7 @@ resource "azurerm_virtual_machine" "vm-linux" { } resource "azurerm_virtual_machine" "vm-linux-with-datadisk" { - count = "${!contains(list("${var.vm_os_simple}","${var.vm_os_offer}"), "WindowsServer") && var.is_windows_image != "true" && var.data_disk == "true" ? var.nb_instances : 0}" + count = "${!contains(list("${var.vm_os_simple}","${var.vm_os_offer}"), "Windows") && var.is_windows_image != "true" && var.data_disk == "true" ? var.nb_instances : 0}" name = "${var.vm_hostname}${count.index}" location = "${var.location}" resource_group_name = "${azurerm_resource_group.vm.name}" @@ -140,7 +140,7 @@ resource "azurerm_virtual_machine" "vm-linux-with-datadisk" { } resource "azurerm_virtual_machine" "vm-windows" { - count = "${(((var.vm_os_id != "" && var.is_windows_image == "true") || contains(list("${var.vm_os_simple}","${var.vm_os_offer}"), "WindowsServer")) && var.data_disk == "false") ? var.nb_instances : 0}" + count = "${((var.is_windows_image == "true" || contains(list("${var.vm_os_simple}","${var.vm_os_offer}"), "Windows")) && var.data_disk == "false") ? var.nb_instances : 0}" name = "${var.vm_hostname}${count.index}" location = "${var.location}" resource_group_name = "${azurerm_resource_group.vm.name}" @@ -181,7 +181,7 @@ resource "azurerm_virtual_machine" "vm-windows" { } resource "azurerm_virtual_machine" "vm-windows-with-datadisk" { - count = "${((var.vm_os_id != "" && var.is_windows_image == "true") || contains(list("${var.vm_os_simple}","${var.vm_os_offer}"), "WindowsServer")) && var.data_disk == "true" ? var.nb_instances : 0}" + count = "${(var.is_windows_image == "true" || contains(list("${var.vm_os_simple}","${var.vm_os_offer}"), "Windows")) && var.data_disk == "true" ? var.nb_instances : 0}" name = "${var.vm_hostname}${count.index}" location = "${var.location}" resource_group_name = "${azurerm_resource_group.vm.name}"