Terraform.VirtualMachines/terraform/main.tf
djpbessems 54c076cc46
Some checks failed
continuous-integration/drone/push Build is failing
Fix typo;Disable lock-file debugging
2021-03-31 09:47:41 +02:00

42 lines
995 B
HCL

terraform {
backend "pg" {}
required_providers {
vsphere = {
source = "hashicorp/vsphere"
version = "~> 1.25.0"
}
}
}
provider "vsphere" {
vsphere_server = var.hv_fqdn
user = var.hv_username
password = var.hv_password
allow_unverified_ssl = true
}
data "vsphere_datacenter" "dc" {
name = var.hv_datacenter
}
data "vsphere_resource_pool" "pool" {
name = "/${var.hv_datacenter}/host/${var.hv_host}/Resources"
datacenter_id = data.vsphere_datacenter.dc.id
}
data "vsphere_host" "host" {
name = var.hv_host
datacenter_id = data.vsphere_datacenter.dc.id
}
data "vsphere_datastore" "datastore" {
name = var.hv_datastore
datacenter_id = data.vsphere_datacenter.dc.id
}
data "vsphere_network" "network" {
name = var.hv_network
datacenter_id = data.vsphere_datacenter.dc.id
}