Skip to content

Commit

Permalink
Merge pull request #101 from dstoffel/feature/check-vmfolder
Browse files Browse the repository at this point in the history
Check if var.vmfolder exists
  • Loading branch information
Arman-Keyoumarsi authored Aug 11, 2021
2 parents be8f023 + 52e2223 commit c21233f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ data "vsphere_tag" "tag" {
depends_on = [var.tag_depends_on]
}

data "vsphere_folder" "folder" {
count = var.vmfolder != null ? 1 : 0
path = "/${data.vsphere_datacenter.dc.name}/vm/${var.vmfolder}"
}

locals {
interface_count = length(var.ipv4submask) #Used for Subnet handeling
template_disk_count = length(data.vsphere_virtual_machine.template.disks)
Expand Down

0 comments on commit c21233f

Please sign in to comment.