github.com/SUSE/skuba@v1.4.17/ci/infra/vmware/main.tf (about)

     1  provider "vsphere" {
     2    version = "~> 1.17"
     3  }
     4  
     5  data "vsphere_resource_pool" "pool" {
     6    name          = var.vsphere_resource_pool
     7    datacenter_id = data.vsphere_datacenter.dc.id
     8  }
     9  
    10  data "vsphere_datastore" "datastore" {
    11    count         = var.vsphere_datastore == "null" || var.vsphere_datastore == null ? 0 : 1
    12    name          = var.vsphere_datastore
    13    datacenter_id = data.vsphere_datacenter.dc.id
    14  }
    15  
    16  data "vsphere_datastore_cluster" "datastore" {
    17    count         = var.vsphere_datastore_cluster == "null" || var.vsphere_datastore_cluster == null ? 0 : 1
    18    name          = var.vsphere_datastore_cluster
    19    datacenter_id = data.vsphere_datacenter.dc.id
    20  }
    21  
    22  data "vsphere_datacenter" "dc" {
    23    name = var.vsphere_datacenter
    24  }
    25  
    26  data "vsphere_network" "network" {
    27    name          = var.vsphere_network
    28    datacenter_id = data.vsphere_datacenter.dc.id
    29  }
    30  
    31  data "vsphere_virtual_machine" "template" {
    32    name          = var.template_name
    33    datacenter_id = data.vsphere_datacenter.dc.id
    34  }
    35  
    36  resource "vsphere_folder" "folder" {
    37    count         = var.cpi_enable == true ? 1 : 0
    38    path          = "${var.stack_name}-cluster"
    39    type          = "vm"
    40    datacenter_id = data.vsphere_datacenter.dc.id
    41  }