Skip to content

Commit c8c5eed

Browse files
author
Arman Keyoumarsi
committed
Fixed Network example
1 parent 2ca02d0 commit c8c5eed

File tree

5 files changed

+15
-136
lines changed

5 files changed

+15
-136
lines changed

CHANGELOG.md

Lines changed: 0 additions & 84 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Terraform Version](https://img.shields.io/badge/Terraform-0.14-green.svg) [![TF Registry](https://img.shields.io/badge/terraform-registry-blue.svg)](https://registry.terraform.io/modules/Terraform-VMWare-Modules/vm/vsphere/) [![Changelog](https://img.shields.io/badge/changelog-release-green.svg)](https://github.com/Terraform-VMWare-Modules/terraform-vsphere-vm/releases) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
44

5-
For Virtual Machine Provisioning with (Linux/Windows) customization. Based on Terraform v0.13 and up, this module include most of the advance features that are available in the resource `vsphere_virtual_machine`.
5+
For Virtual Machine Provisioning with (Linux/Windows) customization. Based on Terraform v0.13 and up, this module include most of the advance features that are available in resource `vsphere_virtual_machine`.
66

77
## Deploys (Single/Multiple) Virtual Machines to your vSphere environment
88

examples/example-linux-Netwrok.tf

Lines changed: 0 additions & 35 deletions
This file was deleted.

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ resource "vsphere_virtual_machine" "vm" {
141141
dynamic "linux_options" {
142142
for_each = var.is_windows_image ? [] : [1]
143143
content {
144-
host_name = "%{if var.vmnameliteral != ""}${var.vmnameliteral}%{else}${var.vmname}${count.index + 1}${var.vmnamesuffix}%{endif}"
144+
host_name = var.instances == 1 ? var.vmname : format("${var.vmname}${var.vmnameformat}", count.index + 1)
145145
domain = var.vmdomain
146146
hw_clock_utc = var.hw_clock_utc
147147
}

tests/sanity/main.tf

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,19 @@ variable "env" {
2121

2222
variable "vm" {
2323
type = map(object({
24-
vmname = string
25-
vmtemp = string
26-
dc = string
27-
vmrp = string
28-
vmfolder = string
29-
datastore = string
30-
template_storage_policy_id = list(string)
31-
is_windows_image = bool
32-
tags = map(string)
33-
instances = number
34-
network = map(list(string))
35-
vmgateway = string
36-
dns_servers = list(string)
37-
data_disk = map(map(string))
24+
vmname = string
25+
vmtemp = string
26+
dc = string
27+
vmrp = string
28+
vmfolder = string
29+
datastore = string
30+
is_windows_image = bool
31+
tags = map(string)
32+
instances = number
33+
network = map(list(string))
34+
vmgateway = string
35+
dns_servers = list(string)
36+
data_disk = map(map(string))
3837
}))
3938
}
4039

@@ -54,6 +53,5 @@ module "example-server-basic" {
5453
vmgateway = each.value.vmgateway
5554
dc = each.value.dc
5655
datastore = each.value.datastore
57-
template_storage_policy_id = each.value.template_storage_policy_id
5856
data_disk = each.value.data_disk
5957
}

0 commit comments

Comments
 (0)