Skip to content

Commit fed6e6d

Browse files
committed
Inherited firmware/enable_disk_uuid/efi_secure_boot
1 parent 942d563 commit fed6e6d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ resource "vsphere_virtual_machine" "vm" {
6666
custom_attributes = var.custom_attributes
6767
annotation = var.annotation
6868
extra_config = var.extra_config
69-
firmware = var.firmware
70-
efi_secure_boot_enabled = var.efi_secure_boot
71-
enable_disk_uuid = var.enable_disk_uuid
69+
firmware = var.firmware == null ? data.vsphere_virtual_machine.template.firmware : var.firmware
70+
efi_secure_boot_enabled = var.efi_secure_boot == null ? data.vsphere_virtual_machine.template.efi_secure_boot_enabled : var.efi_secure_boot
71+
enable_disk_uuid = var.enable_disk_uuid == null ? data.vsphere_virtual_machine.template.enable_disk_uuid : var.enable_disk_uuid
7272
storage_policy_id = var.storage_policy_id
7373

7474
datastore_cluster_id = var.datastore_cluster != "" ? data.vsphere_datastore_cluster.datastore_cluster[0].id : null

variables.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ variable "scsi_controller" {
9898
}
9999

100100
variable "enable_disk_uuid" {
101-
description = "Expose the UUIDs of attached virtual disks to the virtual machine, allowing access to them in the guest."
101+
description = "Expose the UUIDs of attached virtual disks to the virtual machine, allowing access to them in the guest. Default: Inherited from cloned template"
102102
type = bool
103103
default = null
104104
}
@@ -232,13 +232,13 @@ variable "dns_suffix_list" {
232232
}
233233

234234
variable "firmware" {
235-
description = "The firmware interface to use on the virtual machine. Can be one of bios or EFI."
236-
default = "bios"
235+
description = "The firmware interface to use on the virtual machine. Can be one of bios or EFI. Default: Inherited from cloned template"
236+
default = null
237237
}
238238

239239
variable "efi_secure_boot" {
240-
description = "Enables EFI secure boot. Can be only be true when firmware is EFI."
241-
default = "false"
240+
description = "Enables EFI secure boot. Can be only be true when firmware is EFI. Default: Inherited from cloned template"
241+
default = null
242242
}
243243

244244
variable "num_cores_per_socket" {

0 commit comments

Comments
 (0)