fix(vmware): using data providers instead of vm definition values

This commit is contained in:
Philippe Caseiro 2023-07-05 10:10:11 +02:00
parent 97091fb95e
commit eaea580fef
1 changed files with 3 additions and 5 deletions

View File

@ -14,8 +14,6 @@ variable "vms" {
mac = string mac = string
} }
)) ))
resource_pool_id = string
datastore_id = string
folder = string folder = string
} }
)) ))
@ -57,10 +55,10 @@ data "vsphere_network" "network" {
resource "vsphere_virtual_virtual_machine" "vm" { resource "vsphere_virtual_virtual_machine" "vm" {
for_each = var.vms for_each = var.vms
iterator = "machine" iterator = "machines"
name = "${machine.key}.${machine.value.domain}" name = "${machine.key}.${machine.value.domain}"
resource_pool_id = "${machine.key.resource_pool_id}" resource_pool_id = data.vsphere_resource_pool.id
datastore_id = machine.key.datastore_id datastore_id = data.vsphere_datastore.id
folder = machine.folder folder = machine.folder
num_cpus = machine.cpu num_cpus = machine.cpu
memory = machine.ram memory = machine.ram