Skip to content

Commit

Permalink
Merge pull request #60 from Terraform-VMWare-Modules/rc/v3.0.0
Browse files Browse the repository at this point in the history
Added storage_policy_id
  • Loading branch information
Arman-Keyoumarsi authored Dec 13, 2020
2 parents 1482768 + e497e24 commit ea39d22
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 34 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ resource "vsphere_virtual_machine" "Linux" {
extra_config = var.extra_config
firmware = var.firmware
enable_disk_uuid = var.enable_disk_uuid
storage_policy_id = var.storage_policy_id

datastore_cluster_id = var.datastore_cluster != "" ? data.vsphere_datastore_cluster.datastore_cluster[0].id : null
datastore_id = var.datastore != "" ? data.vsphere_datastore.datastore[0].id : null
Expand Down
19 changes: 19 additions & 0 deletions tests/smoke/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/smoke/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ vm = {
vmgateway = "10.13.13.1"
dns_servers = ["1.1.1.1"]
network = {
"DEEDC-ECOM-INT-VLAN189" = ["10.13.13.2"],
"VM Networks" = ["10.13.13.2"],
}
}
}
Expand Down
50 changes: 25 additions & 25 deletions tests/smoke/main.tf
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
variable "vm" {
type = map(object({
vmname = string
vmtemp = string
annotation = string
dc = string
vmrp = string
vmfolder = string
datastore_cluster = string
is_windows_image = bool
instances = number
network = map(list(string))
vmgateway = string
dns_servers = list(string)
vmname = string
vmtemp = string
annotation = string
dc = string
vmrp = string
vmfolder = string
datastore = string
is_windows_image = bool
instances = number
network = map(list(string))
vmgateway = string
dns_servers = list(string)
}))
}

module "example-server-basic" {
source = "../../"
for_each = var.vm
vmtemp = each.value.vmtemp
annotation = each.value.annotation
is_windows_image = each.value.is_windows_image
instances = each.value.instances
vmname = each.value.vmname
vmrp = each.value.vmrp
vmfolder = each.value.vmfolder
network = each.value.network
vmgateway = each.value.vmgateway
dc = each.value.dc
datastore_cluster = each.value.datastore_cluster #Either
source = "../../"
for_each = var.vm
vmtemp = each.value.vmtemp
annotation = each.value.annotation
is_windows_image = each.value.is_windows_image
instances = each.value.instances
vmname = each.value.vmname
vmrp = each.value.vmrp
vmfolder = each.value.vmfolder
network = each.value.network
vmgateway = each.value.vmgateway
dc = each.value.dc
datastore = each.value.datastore #Either
}
22 changes: 14 additions & 8 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ variable "network" {

variable "network_type" {
description = "Define network type for each network interface."
type = list
type = list(any)
default = null
}

variable "ipv4submask" {
description = "ipv4 Subnet mask."
type = list
type = list(any)
default = ["24"]
}

Expand All @@ -36,13 +36,13 @@ variable "data_disk" {

variable "disk_label" {
description = "Storage data disk labels."
type = list
type = list(any)
default = []
}

variable "disk_size_gb" {
description = "List of disk sizes to override template disk size."
type = list
type = list(any)
default = null
}

Expand Down Expand Up @@ -79,6 +79,12 @@ variable "enable_disk_uuid" {
type = bool
default = null
}

variable "storage_policy_id" {
description = "(Optional) The UUID of the storage policy to assign to VM home directory."
default = null
}

###########################################
variable "vmname" {
description = "The name of the virtual machine used to deploy the vms."
Expand Down Expand Up @@ -146,25 +152,25 @@ variable "vmdns" {
#Global Customization Variables
variable "tags" {
description = "The names of any tags to attach to this resource. They must already exist."
type = map
type = map(any)
default = null
}

variable "tag_ids" {
description = "The ids of any tags to attach to this resource. They must already exist."
type = list
type = list(any)
default = null
}

variable "custom_attributes" {
description = "Map of custom attribute ids to attribute value strings to set for virtual machine."
type = map
type = map(any)
default = null
}

variable "extra_config" {
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'."
type = map
type = map(any)
default = null
}

Expand Down

0 comments on commit ea39d22

Please sign in to comment.