Newer
Older
# =================== #
# Deploying VMware VM #
# =================== #
terraform {
required_providers {
vsphere = {
version = "2.2.0"
}
}
}
provider "vsphere" {
vim_keep_alive = 30
user = var.vsphere_connection.user
password = var.vsphere_connection.password
vsphere_server = var.vsphere_connection
}
# Master VM
module "vsphere_vm_master" {
count = var.master_nodes
source = "../tf-vmware-ubuntu"
vm_guest_config = var.vm_guest_config
vm_template = var.vm_template
vsphere_connection = var.vsphere_connection
master_nodes = var.master_nodes
worker_nodes = var.worker_nodes
}
# Worker VM
module "vsphere_vm_worker" {
for_each = var.worker_nodes
source = "../tf-vmware-ubuntu"
vm_guest_config = var.vm_guest_config
vm_template = var.vm_template
vsphere_connection = var.vsphere_connection
master_nodes = var.master_nodes
worker_nodes = var.worker_nodes