Skip to content

Commit ea39d22

Browse files
Merge pull request #60 from Terraform-VMWare-Modules/rc/v3.0.0
Added storage_policy_id
2 parents 1482768 + e497e24 commit ea39d22

File tree

5 files changed

+60
-34
lines changed

5 files changed

+60
-34
lines changed

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ resource "vsphere_virtual_machine" "Linux" {
6868
extra_config = var.extra_config
6969
firmware = var.firmware
7070
enable_disk_uuid = var.enable_disk_uuid
71+
storage_policy_id = var.storage_policy_id
7172

7273
datastore_cluster_id = var.datastore_cluster != "" ? data.vsphere_datastore_cluster.datastore_cluster[0].id : null
7374
datastore_id = var.datastore != "" ? data.vsphere_datastore.datastore[0].id : null

tests/smoke/.terraform.lock.hcl

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/smoke/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ vm = {
2323
vmgateway = "10.13.13.1"
2424
dns_servers = ["1.1.1.1"]
2525
network = {
26-
"DEEDC-ECOM-INT-VLAN189" = ["10.13.13.2"],
26+
"VM Networks" = ["10.13.13.2"],
2727
}
2828
}
2929
}

tests/smoke/main.tf

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
variable "vm" {
22
type = map(object({
3-
vmname = string
4-
vmtemp = string
5-
annotation = string
6-
dc = string
7-
vmrp = string
8-
vmfolder = string
9-
datastore_cluster = string
10-
is_windows_image = bool
11-
instances = number
12-
network = map(list(string))
13-
vmgateway = string
14-
dns_servers = list(string)
3+
vmname = string
4+
vmtemp = string
5+
annotation = string
6+
dc = string
7+
vmrp = string
8+
vmfolder = string
9+
datastore = string
10+
is_windows_image = bool
11+
instances = number
12+
network = map(list(string))
13+
vmgateway = string
14+
dns_servers = list(string)
1515
}))
1616
}
1717

1818
module "example-server-basic" {
19-
source = "../../"
20-
for_each = var.vm
21-
vmtemp = each.value.vmtemp
22-
annotation = each.value.annotation
23-
is_windows_image = each.value.is_windows_image
24-
instances = each.value.instances
25-
vmname = each.value.vmname
26-
vmrp = each.value.vmrp
27-
vmfolder = each.value.vmfolder
28-
network = each.value.network
29-
vmgateway = each.value.vmgateway
30-
dc = each.value.dc
31-
datastore_cluster = each.value.datastore_cluster #Either
19+
source = "../../"
20+
for_each = var.vm
21+
vmtemp = each.value.vmtemp
22+
annotation = each.value.annotation
23+
is_windows_image = each.value.is_windows_image
24+
instances = each.value.instances
25+
vmname = each.value.vmname
26+
vmrp = each.value.vmrp
27+
vmfolder = each.value.vmfolder
28+
network = each.value.network
29+
vmgateway = each.value.vmgateway
30+
dc = each.value.dc
31+
datastore = each.value.datastore #Either
3232
}

variables.tf

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ variable "network" {
77

88
variable "network_type" {
99
description = "Define network type for each network interface."
10-
type = list
10+
type = list(any)
1111
default = null
1212
}
1313

1414
variable "ipv4submask" {
1515
description = "ipv4 Subnet mask."
16-
type = list
16+
type = list(any)
1717
default = ["24"]
1818
}
1919

@@ -36,13 +36,13 @@ variable "data_disk" {
3636

3737
variable "disk_label" {
3838
description = "Storage data disk labels."
39-
type = list
39+
type = list(any)
4040
default = []
4141
}
4242

4343
variable "disk_size_gb" {
4444
description = "List of disk sizes to override template disk size."
45-
type = list
45+
type = list(any)
4646
default = null
4747
}
4848

@@ -79,6 +79,12 @@ variable "enable_disk_uuid" {
7979
type = bool
8080
default = null
8181
}
82+
83+
variable "storage_policy_id" {
84+
description = "(Optional) The UUID of the storage policy to assign to VM home directory."
85+
default = null
86+
}
87+
8288
###########################################
8389
variable "vmname" {
8490
description = "The name of the virtual machine used to deploy the vms."
@@ -146,25 +152,25 @@ variable "vmdns" {
146152
#Global Customization Variables
147153
variable "tags" {
148154
description = "The names of any tags to attach to this resource. They must already exist."
149-
type = map
155+
type = map(any)
150156
default = null
151157
}
152158

153159
variable "tag_ids" {
154160
description = "The ids of any tags to attach to this resource. They must already exist."
155-
type = list
161+
type = list(any)
156162
default = null
157163
}
158164

159165
variable "custom_attributes" {
160166
description = "Map of custom attribute ids to attribute value strings to set for virtual machine."
161-
type = map
167+
type = map(any)
162168
default = null
163169
}
164170

165171
variable "extra_config" {
166172
description = "Extra configuration data for this virtual machine. Can be used to supply advanced parameters not normally in configuration, such as instance metadata.'disk.enableUUID', 'True'."
167-
type = map
173+
type = map(any)
168174
default = null
169175
}
170176

0 commit comments

Comments
 (0)