From 8e67d24e0895929582c62c177ccffeb6ab3cb138 Mon Sep 17 00:00:00 2001 From: djpbessems Date: Thu, 3 Mar 2022 10:50:59 +0100 Subject: [PATCH] Create resourcepool --- terraform/main.tf | 3 ++- terraform/variables.tf | 1 + terraform/vsphere.tfvars | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/terraform/main.tf b/terraform/main.tf index 7423988..5bd27e9 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -22,7 +22,8 @@ data "vsphere_datacenter" "dc" { } data "vsphere_resource_pool" "pool" { - name = "/${var.hv_datacenter}/host/${var.hv_host}/Resources" + name = var.hv_resourcepool + // name = "/${var.hv_datacenter}/host/${var.hv_host}/Resources" datacenter_id = data.vsphere_datacenter.dc.id } diff --git a/terraform/variables.tf b/terraform/variables.tf index 1c7ae40..dc2fa6a 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -6,6 +6,7 @@ variable "hv_datacenter" {} variable "hv_host" {} variable "hv_hostip" {} +variable "hv_resourcepool" {} variable "hv_datastore" {} variable "hv_vmfolder" {} variable "hv_network" {} diff --git a/terraform/vsphere.tfvars b/terraform/vsphere.tfvars index 3fdb624..1ab370f 100644 --- a/terraform/vsphere.tfvars +++ b/terraform/vsphere.tfvars @@ -1,6 +1,7 @@ hv_fqdn = "bv11-vc.bessems.lan" hv_username = "administrator@vsphere.local" hv_datacenter = "DeSchakel" +hv_resourcepool = "Terraform" hv_host = "bv11-esx.bessems.lan" hv_hostip = "192.168.11.200" hv_datastore = "Datastore05.NAS"