Terraform.VirtualMachines/terraform/main.tf
djpbessems c01153aa45
Some checks failed
continuous-integration/drone/push Build is failing
Specify path to default resourcepool #2
2021-02-02 13:48:45 +01:00

41 lines
1.0 KiB
HCL

terraform {
backend "pg" {}
required_providers {
vsphere = {
source = "hashicorp/vsphere"
version = "~> 1.24.3"
}
}
}
provider "vsphere" {
vsphere_server = var.vcenter_server
user = var.vsphere_username
password = var.vsphere_password
allow_unverified_ssl = true
}
data "vsphere_datacenter" "dc" {
name = var.vsphere_datacenter
}
data "vsphere_resource_pool" "pool" {
name = "/${var.vsphere_datacenter}/host/${var.vsphere_host}/Resources"
datacenter_id = data.vsphere_datacenter.dc.id
}
data "vsphere_datastore" "vmdatastore" {
name = var.vsphere_vmdatastore
datacenter_id = data.vsphere_datacenter.dc.id
}
data "vsphere_datastore" "cldatastore" {
name = var.vsphere_cldatastore
datacenter_id = data.vsphere_datacenter.dc.id
}
data "vsphere_network" "network" {
name = var.vsphere_network
datacenter_id = data.vsphere_datacenter.dc.id
}