File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ locals {
8080resource "vsphere_virtual_machine" "vm" {
8181 count = var. instances
8282 depends_on = [var . vm_depends_on ]
83- name = var. staticvmname != null ? var. staticvmname : format (" ${ var . vmname } ${ var . vmnameformat } " , count. index + 1 )
83+ name = " ${ var . staticvmname != null ? var . staticvmname : format (" ${ var . vmname } ${ var . vmnameformat } " , count. index + 1 )} ${ var . fqdnvmname == true ? " . ${ var . domain } " : " " } "
8484
8585 resource_pool_id = var. vmrp != " " ? data. vsphere_resource_pool . pool [0 ]. id : var. vmrpid
8686 folder = var. vmfolder
Original file line number Diff line number Diff line change @@ -130,6 +130,12 @@ variable "staticvmname" {
130130 default = null
131131}
132132
133+ variable "fqdnvmname" {
134+ description = " If true, the vm will be created using domain variable appended"
135+ type = bool
136+ default = false
137+ }
138+
133139variable "vmtemp" {
134140 description = " Name of the template available in the vSphere."
135141}
@@ -307,7 +313,7 @@ variable "hw_clock_utc" {
307313}
308314
309315variable "domain" {
310- description = " default VM domain for linux guest customization."
316+ description = " default VM domain for linux guest customization and fqdn name (if fqdnvmname is true) ."
311317 default = " Development.com"
312318}
313319
You can’t perform that action at this time.
0 commit comments