2021-02-02 12:06:52 +00:00
|
|
|
terraform {
|
|
|
|
backend "pg" {}
|
2021-02-02 12:30:06 +00:00
|
|
|
|
|
|
|
required_providers {
|
|
|
|
vsphere = {
|
|
|
|
source = "hashicorp/vsphere"
|
|
|
|
version = "~> 1.24.3"
|
|
|
|
}
|
|
|
|
}
|
2021-02-02 12:06:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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_hostip}/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
|
|
|
|
}
|