Skip to content

Commit

Permalink
Added more documentioan
Browse files Browse the repository at this point in the history
  • Loading branch information
Arman Keyoumarsi committed Apr 23, 2021
1 parent e22658d commit c978955
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 25 deletions.
6 changes: 6 additions & 0 deletions examples/example-Windows-data_disk.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
data "vsphere_storage_policy" "policy" {
name = "policy1"
}

module "example-server-windowsvm-advanced" {
source = "Terraform-VMWare-Modules/vm/vsphere"
version = "X.X.X"
Expand All @@ -12,11 +16,13 @@ module "example-server-windowsvm-advanced" {
network = {
"Name of the Port Group in vSphere" = ["10.13.113.2", "10.13.113.3"] # To use DHCP create Empty list ["",""]
}
template_storage_policy_id = [data.vsphere_storage_policy.this.id] #Policy ID for the template disks
data_disk = {
disk1 = {
size_gb = 30,
thin_provisioned = false,
data_disk_scsi_controller = 0,
storage_policy_id = "ff45cc66-b624-4621-967f-1aef6437f568" #Different policy ID for data disks
},
disk2 = {
size_gb = 70,
Expand Down
9 changes: 0 additions & 9 deletions examples/example-linux-depend_on.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ module "example-server-linuxvm-advanced" {
"Network01" = ["10.13.113.2", "10.13.113.3"] # To use DHCP create Empty list ["",""]
"Network02" = ["", ""] #Second Network will use the DHCP
}
disk_label = ["tpl-disk-1"]
data_disk_label = ["label1", "label2"]
scsi_type = "lsilogic" # "pvscsi"
scsi_controller = 0
data_disk_scsi_controller = [0, 1]
disk_datastore = "vsanDatastore"
data_disk_datastore = ["vsanDatastore", "nfsDatastore"]
data_disk_size_gb = [10, 5] // Aditional Disks to be used
thin_provisioned = [true, false]
vmdns = ["192.168.0.2", "192.168.0.1"]
vmgateway = "192.168.0.1"
network_type = ["vmxnet3", "vmxnet3"]
Expand Down
42 changes: 26 additions & 16 deletions tests/sanity/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ variable "env" {
default = "dev"
}

data "vsphere_storage_policy" "this" {
name = "Test"
}

output "disk_id" {
value = data.vsphere_storage_policy.this.id
}

variable "vm" {
type = map(object({
vmname = string
Expand All @@ -38,20 +46,22 @@ variable "vm" {
}

module "example-server-basic" {
source = "../../"
for_each = var.vm
vmnameformat = "%03d${var.env}"
tag_depends_on = [vsphere_tag.tag.id]
tags = each.value.tags
vmtemp = each.value.vmtemp
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
data_disk = each.value.data_disk
source = "../../"
for_each = var.vm
vmnameformat = "%03d${var.env}"
template_storage_policy_id = [data.vsphere_storage_policy.this.id]
tag_depends_on = [vsphere_tag.tag.id]
tags = each.value.tags
vmtemp = each.value.vmtemp
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
data_disk = each.value.data_disk
}

0 comments on commit c978955

Please sign in to comment.