Skip to content

Commit b76dea6

Browse files
committed
Rename variable to template_storage_policy_id
Signed-off-by: Stéphane Este-Gracias <sestegra@gmail.com>
1 parent 3fb2c9e commit b76dea6

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ resource "vsphere_virtual_machine" "Linux" {
115115
thin_provisioned = data.vsphere_virtual_machine.template.disks[template_disks.key].thin_provisioned
116116
eagerly_scrub = data.vsphere_virtual_machine.template.disks[template_disks.key].eagerly_scrub
117117
datastore_id = var.disk_datastore != "" ? data.vsphere_datastore.disk_datastore[0].id : null
118-
storage_policy_id = length(var.disk_storage_policy_id) > 0 ? var.disk_storage_policy_id[template_disks.key] : null
118+
storage_policy_id = length(var.template_storage_policy_id) > 0 ? var.template_storage_policy_id[template_disks.key] : null
119119
}
120120
}
121121
// Additional disks defined by Terraform config
@@ -231,7 +231,7 @@ resource "vsphere_virtual_machine" "Windows" {
231231
thin_provisioned = data.vsphere_virtual_machine.template.disks[template_disks.key].thin_provisioned
232232
eagerly_scrub = data.vsphere_virtual_machine.template.disks[template_disks.key].eagerly_scrub
233233
datastore_id = var.disk_datastore != "" ? data.vsphere_datastore.disk_datastore[0].id : null
234-
storage_policy_id = length(var.disk_storage_policy_id) > 0 ? var.disk_storage_policy_id[template_disks.key] : null
234+
storage_policy_id = length(var.template_storage_policy_id) > 0 ? var.template_storage_policy_id[template_disks.key] : null
235235
}
236236
}
237237

tests/sanity/main.tf

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,38 @@ resource "vsphere_tag" "tag" {
1717

1818
variable "vm" {
1919
type = map(object({
20-
vmname = string
21-
vmtemp = string
22-
dc = string
23-
vmrp = string
24-
vmfolder = string
25-
datastore = string
26-
disk_storage_policy_id = list(string)
27-
is_windows_image = bool
28-
tags = map(string)
29-
instances = number
30-
network = map(list(string))
31-
vmgateway = string
32-
dns_servers = list(string)
33-
data_disk = map(map(string))
20+
vmname = string
21+
vmtemp = string
22+
dc = string
23+
vmrp = string
24+
vmfolder = string
25+
datastore = string
26+
template_storage_policy_id = list(string)
27+
is_windows_image = bool
28+
tags = map(string)
29+
instances = number
30+
network = map(list(string))
31+
vmgateway = string
32+
dns_servers = list(string)
33+
data_disk = map(map(string))
3434
}))
3535
}
3636

3737
module "example-server-basic" {
38-
source = "../../"
39-
for_each = var.vm
40-
tag_depends_on = [vsphere_tag.tag.id]
41-
tags = each.value.tags
42-
vmtemp = each.value.vmtemp
43-
is_windows_image = each.value.is_windows_image
44-
instances = each.value.instances
45-
vmname = each.value.vmname
46-
vmrp = each.value.vmrp
47-
vmfolder = each.value.vmfolder
48-
network = each.value.network
49-
vmgateway = each.value.vmgateway
50-
dc = each.value.dc
51-
datastore = each.value.datastore
52-
disk_storage_policy_id = each.value.disk_storage_policy_id
53-
data_disk = each.value.data_disk
38+
source = "../../"
39+
for_each = var.vm
40+
tag_depends_on = [vsphere_tag.tag.id]
41+
tags = each.value.tags
42+
vmtemp = each.value.vmtemp
43+
is_windows_image = each.value.is_windows_image
44+
instances = each.value.instances
45+
vmname = each.value.vmname
46+
vmrp = each.value.vmrp
47+
vmfolder = each.value.vmfolder
48+
network = each.value.network
49+
vmgateway = each.value.vmgateway
50+
dc = each.value.dc
51+
datastore = each.value.datastore
52+
template_storage_policy_id = each.value.template_storage_policy_id
53+
data_disk = each.value.data_disk
5454
}

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ variable "disk_datastore" {
5252
default = ""
5353
}
5454

55-
variable "disk_storage_policy_id" {
55+
variable "template_storage_policy_id" {
5656
description = "List of UUIDs of the storage policy to assign to the template disk."
5757
type = list(any)
5858
default = []

0 commit comments

Comments
 (0)